logic: Fixed code view single not cleared properly in some cases

This commit is contained in:
Eberhard Graether
2017-02-13 13:20:20 +01:00
parent 8a93bebff8
commit 259b112080
7 changed files with 27 additions and 5 deletions
+5 -4
View File
@@ -148,6 +148,7 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
updateRecentProjects(projectSettingsFilePath);
m_storageCache->clear();
m_storageCache->setSubject(nullptr);
m_project = m_projectFactory.createProject(projectSettingsFilePath, m_storageCache.get(), getDialogView());
@@ -157,8 +158,6 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
{
setTitle("Coati - " + projectSettingsFilePath.fileName());
m_mainView->hideStartScreen();
m_componentManager->clearComponents();
}
}
else
@@ -169,9 +168,11 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
}
catch (...)
{
LOG_ERROR_STREAM(<< "Failed to load project.");
MessageStatus("Failed to load project: " + projectSettingsFilePath.str(), true).dispatch();
LOG_ERROR_STREAM(<< "Failed to load project, exception thrown.");
MessageStatus("Failed to load project, exception was thrown: " + projectSettingsFilePath.str(), true).dispatch();
}
m_componentManager->clearComponents();
}
void Application::refreshProject(bool force)
@@ -107,7 +107,7 @@ void CodeController::handleMessage(MessageActivateTokens* message)
if (!message->keepContent())
{
view->clear();
view->clearCodeSnippets();
}
std::vector<Id> activeTokenIds = message->tokenIds;
+1
View File
@@ -29,6 +29,7 @@ public:
virtual std::string getName() const;
virtual void clear() = 0;
virtual void clearCodeSnippets() = 0;
virtual void setErrorInfos(const std::vector<ErrorInfo>& errorInfos) = 0;
virtual bool showsErrors() const = 0;
@@ -192,6 +192,12 @@ void QtCodeNavigator::addedFiles()
}
}
void QtCodeNavigator::clear()
{
clearCodeSnippets();
clearCaches();
}
void QtCodeNavigator::clearCodeSnippets()
{
m_list->clear();
+1
View File
@@ -37,6 +37,7 @@ public:
void addedFiles();
void clear();
void clearCodeSnippets();
void clearCaches();
+12
View File
@@ -55,6 +55,18 @@ void QtCodeView::refreshView()
}
void QtCodeView::clear()
{
m_onQtThread(
[=]()
{
m_widget->clear();
}
);
m_errorInfos.clear();
}
void QtCodeView::clearCodeSnippets()
{
m_onQtThread(
[=]()
+1
View File
@@ -27,6 +27,7 @@ public:
// CodeView implementation
virtual void clear();
virtual void clearCodeSnippets();
virtual void setErrorInfos(const std::vector<ErrorInfo>& errorInfos);
virtual bool showsErrors() const;