logic: Show overview instead of empty error screen after all indexing errors were fixed

This commit is contained in:
Eberhard Graether
2019-08-05 14:33:14 +02:00
parent 2f21848de8
commit 5f91f48844
3 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -219,7 +219,7 @@ void Application::handleMessage(MessageIndexingFinished* message)
if (m_hasGUI)
{
MessageRefreshUI().dispatch();
MessageRefreshUI().afterIndexing().dispatch();
}
else
{
@@ -364,7 +364,16 @@ void UndoRedoController::handleMessage(MessageIndexingFinished* message)
void UndoRedoController::handleMessage(MessageRefreshUI* message)
{
if (m_iterator == m_list.begin())
std::list<Command>::iterator startIterator = m_iterator;
do
{
std::advance(startIterator, -1);
}
while (startIterator != m_list.begin() && startIterator->order != Command::ORDER_ACTIVATE);
if (startIterator == m_list.begin() ||
(message->isAfterIndexing && dynamic_cast<MessageActivateErrors*>(startIterator->message.get()) &&
m_storageAccess->getErrorCount().total == 0))
{
MessageActivateAll msg;
msg.setSchedulerId(getSchedulerId());
@@ -14,6 +14,7 @@ public:
MessageRefreshUI()
: loadStyle(true)
, isAfterIndexing(false)
{
}
@@ -23,6 +24,12 @@ public:
return *this;
}
MessageRefreshUI& afterIndexing()
{
isAfterIndexing = true;
return *this;
}
void print(std::wostream& os) const override
{
if (loadStyle)
@@ -32,6 +39,7 @@ public:
}
bool loadStyle;
bool isAfterIndexing;
};
#endif // MESSAGE_REFRESH_UI_H