locig: refresh after edit project

* implemented saving project settings force-refreshes the project if something has changed.
* when nothing has changed while editing the project settings, the project is not refreshed anymore.
* new project window is cleared now before it is displayed.
This commit is contained in:
malte_langkabel
2016-01-18 10:59:32 +01:00
parent 3852bb7e5c
commit 743f91e882
11 changed files with 78 additions and 45 deletions
+9 -3
View File
@@ -25,7 +25,7 @@ Project::~Project()
{
}
bool Project::loadProject(const FilePath& projectSettingsFile)
bool Project::load(const FilePath& projectSettingsFile, bool forceRefresh)
{
bool success = ProjectSettings::getInstance()->load(projectSettingsFile);
if (success)
@@ -34,6 +34,12 @@ bool Project::loadProject(const FilePath& projectSettingsFile)
updateFileManager();
}
if (forceRefresh)
{
clearStorage();
m_storageWasLoaded = false;
}
if (m_storageWasLoaded)
{
m_storage->startParsing();
@@ -50,7 +56,7 @@ bool Project::loadProject(const FilePath& projectSettingsFile)
return success;
}
bool Project::saveProject(const FilePath& projectSettingsFile)
bool Project::save(const FilePath& projectSettingsFile)
{
if (!projectSettingsFile.empty())
{
@@ -69,7 +75,7 @@ bool Project::saveProject(const FilePath& projectSettingsFile)
return true;
}
void Project::reloadProject()
void Project::reload()
{
if (!m_projectSettingsFilepath.empty())
{