Skip to content

Commit

Permalink
Stopped old process before start a new one deskflow#4908
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Jul 31, 2015
1 parent e472e47 commit d70c19b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/gui/src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,19 +451,13 @@ void MainWindow::checkFingerprint(const QString& line)
.arg(fingerprint),
QMessageBox::Yes | QMessageBox::No);

stopSynergy();

if (fingerprintReply == QMessageBox::Yes) {
// restart core process after trusting fingerprint.
Fingerprint::trustedServers().trust(fingerprint);
startSynergy();
}
else {
// on all platforms, the core process will stop if the
// fingerprint is not trusted, so technically the stop
// isn't really needed. however on windows, the core
// process will keep trying (and failing) unless we
// tell it to stop.
stopSynergy();
}
}

bool MainWindow::autoHide()
Expand All @@ -483,6 +477,12 @@ QString MainWindow::getTimeStamp()
return '[' + current.toString(Qt::ISODate) + ']';
}

void MainWindow::restartSynergy()
{
stopSynergy();
startSynergy();
}

void MainWindow::clearLog()
{
m_pLogOutput->clear();
Expand Down Expand Up @@ -1072,7 +1072,7 @@ void MainWindow::autoAddScreen(const QString name)
}
}
else {
startSynergy();
restartSynergy();
}
}
}
Expand All @@ -1097,8 +1097,7 @@ void MainWindow::on_m_pActionWizard_triggered()

void MainWindow::on_m_pButtonApply_clicked()
{
stopSynergy();
startSynergy();
restartSynergy();
}

#if defined(Q_OS_WIN)
Expand Down Expand Up @@ -1282,7 +1281,7 @@ void MainWindow::updateEdition()
void MainWindow::on_m_pComboServerList_currentIndexChanged(QString )
{
if (m_pComboServerList->count() != 0) {
startSynergy();
restartSynergy();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/src/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void checkFingerprint(const QString& line);
bool autoHide();
QString getTimeStamp();
void restartSynergy();

private:
QSettings& m_Settings;
Expand Down

0 comments on commit d70c19b

Please sign in to comment.