logic: Fixed and improved indexing interruption (issue #634)

* Fixed indexing can be interrupted when dialog hidden
* Clear intermediate storages when interrupting
* Abort waiting for less queued storages when indexing interrupted
* Don't index another file when indexing was already interrupted
* Moved indexing interrupted progress dialog to TaskBuildIndex
* Use MessageIndexingInterrupted instead of MessageInterruptTasks
This commit is contained in:
Eberhard Graether
2018-11-23 15:33:20 +01:00
parent 308954635e
commit 267d6b2eb7
17 changed files with 67 additions and 67 deletions
+11 -8
View File
@@ -125,7 +125,10 @@ void TaskBuildIndex::doExit(std::shared_ptr<Blackboard> blackboard)
}
m_processThreads.clear();
while (fetchIntermediateStorages(blackboard));
if (!m_interrupted)
{
while (fetchIntermediateStorages(blackboard));
}
std::vector<FilePath> crashedFiles = m_interprocessIndexingStatusManager.getCrashedSourceFilePaths();
if (crashedFiles.size())
@@ -156,14 +159,14 @@ void TaskBuildIndex::terminate()
utility::killRunningProcesses();
}
void TaskBuildIndex::handleMessage(MessageInterruptTasks* message)
void TaskBuildIndex::handleMessage(MessageIndexingInterrupted* message)
{
if (!m_dialogView->dialogsHidden())
{
LOG_INFO("sending indexer interrupt command.");
m_interprocessIndexingStatusManager.setIndexingInterrupted(true);
m_interrupted = true;
}
LOG_INFO("sending indexer interrupt command.");
m_interprocessIndexingStatusManager.setIndexingInterrupted(true);
m_interrupted = true;
m_dialogView->showUnknownProgressDialog(L"Interrupting Indexing", L"Waiting for indexer\nthreads to finish");
}
void TaskBuildIndex::runIndexerProcess(int processId, const std::wstring& logFilePath)