diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index 17373b142..738dc5ac6 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -153,6 +153,7 @@ AutoType::AutoType(QObject* parent, bool test) #endif } + connect(this, SIGNAL(autotypeFinished()), SLOT(resetAutoTypeState())); connect(qApp, SIGNAL(aboutToQuit()), SLOT(unloadPlugin())); } @@ -353,7 +354,6 @@ void AutoType::executeAutoTypeActions(const Entry* entry, } } - resetAutoTypeState(); m_inAutoType.unlock(); emit autotypeFinished(); } @@ -488,11 +488,9 @@ void AutoType::performGlobalAutoType(const QList>& dbLi m_windowForGlobal, virtualMode ? AutoTypeExecutor::Mode::VIRTUAL : AutoTypeExecutor::Mode::NORMAL); - resetAutoTypeState(); }); connect(selectDialog, &QDialog::rejected, this, [this] { restoreWindowState(); - resetAutoTypeState(); emit autotypeFinished(); }); @@ -506,10 +504,8 @@ void AutoType::performGlobalAutoType(const QList>& dbLi } else if (!matchList.isEmpty()) { // Only one match and not asking, do it! executeAutoTypeActions(matchList.first().first, matchList.first().second, m_windowForGlobal); - resetAutoTypeState(); } else { // We should never get here - resetAutoTypeState(); emit autotypeFinished(); } } diff --git a/src/autotype/AutoType.h b/src/autotype/AutoType.h index 17264dd68..4708a7093 100644 --- a/src/autotype/AutoType.h +++ b/src/autotype/AutoType.h @@ -66,6 +66,7 @@ signals: private slots: void startGlobalAutoType(const QString& search); void unloadPlugin(); + void resetAutoTypeState(); private: enum WindowState @@ -83,7 +84,6 @@ private: WId window = 0, AutoTypeExecutor::Mode mode = AutoTypeExecutor::Mode::NORMAL); void restoreWindowState(); - void resetAutoTypeState(); static QList> parseSequence(const QString& entrySequence, const Entry* entry, QString& error, bool syntaxOnly = false);