Used timer instead of delay #4901
This commit is contained in:
parent
08effbcf99
commit
20cb624c3b
|
@ -782,9 +782,8 @@ void MainWindow::synergyFinished(int exitCode, QProcess::ExitStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_ExpectedRunningState == kStarted) {
|
if (m_ExpectedRunningState == kStarted) {
|
||||||
delay(1);
|
QTimer::singleShot(1000, this, SLOT(startSynergy()));
|
||||||
appendLogInfo(QString("detected process not running, auto restarting"));
|
appendLogInfo(QString("detected process not running, auto restarting"));
|
||||||
startSynergy();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setSynergyState(synergyDisconnected);
|
setSynergyState(synergyDisconnected);
|
||||||
|
@ -1336,12 +1335,3 @@ QString MainWindow::getProfileRootForArg()
|
||||||
|
|
||||||
return QString("\"%1\"").arg(dir);
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -114,7 +114,6 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
|
||||||
void serverDetected(const QString name);
|
void serverDetected(const QString name);
|
||||||
void setEdition(int type);
|
void setEdition(int type);
|
||||||
void updateLocalFingerprint();
|
void updateLocalFingerprint();
|
||||||
void delay(unsigned int);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void appendLogRaw(const QString& text);
|
void appendLogRaw(const QString& text);
|
||||||
|
|
Loading…
Reference in New Issue