forked from qt-creator/qt-creator
Get rid of Utils::sleep
Replace with std::this_thread::sleep_for() Change-Id: I3a02fa6d4fc1b41d8d7b01bb3ba0342ce49b8e61 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
8edda219d9
commit
88aa956bb7
@@ -52,7 +52,6 @@
|
||||
#include <utils/persistentsettings.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/runextensions.h>
|
||||
#include <utils/sleep.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
|
||||
#include <QApplication>
|
||||
@@ -64,7 +63,9 @@
|
||||
#include <QStringList>
|
||||
#include <QTcpSocket>
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -825,7 +826,7 @@ bool AndroidConfig::waitForBooted(const QString &serialNumber, const QFutureInte
|
||||
if (hasFinishedBooting(serialNumber)) {
|
||||
return true;
|
||||
} else {
|
||||
Utils::sleep(2000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
if (!isConnected(serialNumber)) // device was disconnected
|
||||
return false;
|
||||
}
|
||||
@@ -844,7 +845,7 @@ QString AndroidConfig::waitForAvd(const QString &avdName, const QFutureInterface
|
||||
serialNumber = findAvd(avdName);
|
||||
if (!serialNumber.isEmpty())
|
||||
return waitForBooted(serialNumber, fi) ? serialNumber : QString();
|
||||
Utils::sleep(2000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user