From b5861885a2df7022922a9e379ecd38dcc4494952 Mon Sep 17 00:00:00 2001 From: "Maciej S. Szmigiero" Date: Sat, 28 Sep 2019 00:19:32 +0200 Subject: Don't connect MainWindow::passShowHandlerFinished signal two times QtPass::connectPassSignalHandlers() will be called twice, the first time for the real pass and the second time for a pass imitator. This means that we can't connect MainWindow::passShowHandlerFinished signal in this function or it will be connected (and so then invoked) twice. Connect it in the QtPass::connectPassSignalHandlers() single caller instead. --- src/qtpass.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qtpass.cpp b/src/qtpass.cpp index f4465bf7..1c207052 100644 --- a/src/qtpass.cpp +++ b/src/qtpass.cpp @@ -121,6 +121,9 @@ void QtPass::setMainWindow(MainWindow *mW) { connectPassSignalHandlers(QtPassSettings::getRealPass()); connectPassSignalHandlers(QtPassSettings::getImitatePass()); + connect(m_mainWindow, &MainWindow::passShowHandlerFinished, this, + &QtPass::passShowHandlerFinished); + // only for ipass connect(QtPassSettings::getImitatePass(), &ImitatePass::startReencryptPath, m_mainWindow, &MainWindow::startReencryptPath); @@ -144,13 +147,10 @@ void QtPass::setMainWindow(MainWindow *mW) { void QtPass::connectPassSignalHandlers(Pass *pass) { connect(pass, &Pass::error, this, &QtPass::processError); connect(pass, &Pass::processErrorExit, this, &QtPass::processErrorExit); - connect(pass, &Pass::critical, m_mainWindow, &MainWindow::critical); connect(pass, &Pass::startingExecuteWrapper, m_mainWindow, &MainWindow::executeWrapperStarted); connect(pass, &Pass::statusMsg, m_mainWindow, &MainWindow::showStatusMessage); - connect(m_mainWindow, &MainWindow::passShowHandlerFinished, this, - &QtPass::passShowHandlerFinished); connect(pass, &Pass::finishedShow, m_mainWindow, &MainWindow::passShowHandler); connect(pass, &Pass::finishedOtpGenerate, m_mainWindow, -- cgit v1.2.3