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:
@@ -497,25 +497,6 @@ void QtDialogView::handleMessage(MessageIndexingShowDialog* message)
|
||||
);
|
||||
}
|
||||
|
||||
void QtDialogView::handleMessage(MessageInterruptTasks* message)
|
||||
{
|
||||
if (!m_dialogsVisible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_onQtThread3(
|
||||
[=]()
|
||||
{
|
||||
QtIndexingDialog* window = dynamic_cast<QtIndexingDialog*>(m_windowStack.getTopWindow());
|
||||
if (window && window->getType() == QtIndexingDialog::DIALOG_INDEXING)
|
||||
{
|
||||
showUnknownProgressDialog(L"Interrupting Indexing", L"Waiting for indexer\nthreads to finish");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void QtDialogView::handleMessage(MessageErrorCountUpdate* message)
|
||||
{
|
||||
ErrorCountInfo errorInfo = message->errorCount;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "MessageListener.h"
|
||||
#include "MessageErrorCountUpdate.h"
|
||||
#include "MessageIndexingShowDialog.h"
|
||||
#include "MessageInterruptTasks.h"
|
||||
#include "MessageWindowClosed.h"
|
||||
|
||||
class QtIndexingDialog;
|
||||
@@ -21,7 +20,6 @@ class QtDialogView
|
||||
, public DialogView
|
||||
, public MessageListener<MessageErrorCountUpdate>
|
||||
, public MessageListener<MessageIndexingShowDialog>
|
||||
, public MessageListener<MessageInterruptTasks>
|
||||
, public MessageListener<MessageWindowClosed>
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -63,7 +61,6 @@ private slots:
|
||||
private:
|
||||
void handleMessage(MessageErrorCountUpdate* message) override;
|
||||
void handleMessage(MessageIndexingShowDialog* message) override;
|
||||
void handleMessage(MessageInterruptTasks* message) override;
|
||||
void handleMessage(MessageWindowClosed* message) override;
|
||||
|
||||
void updateErrorCount(size_t errorCount, size_t fatalCount);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "QtHelpButton.h"
|
||||
#include "QtProgressBar.h"
|
||||
#include "MessageErrorsHelpMessage.h"
|
||||
#include "MessageInterruptTasks.h"
|
||||
#include "MessageIndexingInterrupted.h"
|
||||
#include "ResourcePaths.h"
|
||||
#include "utility.h"
|
||||
|
||||
@@ -404,7 +404,10 @@ void QtIndexingDialog::handleClose()
|
||||
{
|
||||
if (m_type == DIALOG_INDEXING)
|
||||
{
|
||||
MessageInterruptTasks().dispatch();
|
||||
if (isVisible())
|
||||
{
|
||||
MessageIndexingInterrupted().dispatch();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include "MessageEnteredLicense.h"
|
||||
#include "MessageFind.h"
|
||||
#include "MessageIndexingShowDialog.h"
|
||||
#include "MessageInterruptTasks.h"
|
||||
#include "MessageLoadProject.h"
|
||||
#include "MessageRefresh.h"
|
||||
#include "MessageRefreshUI.h"
|
||||
@@ -493,7 +492,6 @@ void QtMainWindow::keyPressEvent(QKeyEvent* event)
|
||||
break;
|
||||
|
||||
case Qt::Key_Escape:
|
||||
MessageInterruptTasks().dispatch();
|
||||
emit hideScreenSearch();
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user