Used timer instead of delay #4901

This commit is contained in:
Xinyu Hou 2015-07-29 15:15:19 -07:00 committed by Jerry (Xinyu Hou)
parent 08effbcf99
commit 20cb624c3b
2 changed files with 1 additions and 12 deletions

View File

@ -782,9 +782,8 @@ void MainWindow::synergyFinished(int exitCode, QProcess::ExitStatus)
}
if (m_ExpectedRunningState == kStarted) {
delay(1);
QTimer::singleShot(1000, this, SLOT(startSynergy()));
appendLogInfo(QString("detected process not running, auto restarting"));
startSynergy();
}
else {
setSynergyState(synergyDisconnected);
@ -1336,12 +1335,3 @@ QString MainWindow::getProfileRootForArg()
return QString("\"%1\"").arg(dir);
}
void MainWindow::delay(unsigned int s)
{
QTime dieTime= QTime::currentTime().addSecs(s);
while (QTime::currentTime() < dieTime) {
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
}

View File

@ -114,7 +114,6 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void serverDetected(const QString name);
void setEdition(int type);
void updateLocalFingerprint();
void delay(unsigned int);
public slots:
void appendLogRaw(const QString& text);