diff --git a/src/libs/utils/sleep.cpp b/src/libs/utils/sleep.cpp deleted file mode 100644 index ea2610e2b9c..00000000000 --- a/src/libs/utils/sleep.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Orgad Shaneh . -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "sleep.h" - -#ifdef Q_OS_WIN -#include -#else -#include -#include -#endif - -void Utils::sleep(int msec) -{ -#ifdef Q_OS_WIN - ::Sleep(msec); -#else - struct timespec ts = { msec / 1000, (msec % 1000) * 1000000 }; - ::nanosleep(&ts, NULL); -#endif -} diff --git a/src/libs/utils/sleep.h b/src/libs/utils/sleep.h deleted file mode 100644 index c7df10f8f76..00000000000 --- a/src/libs/utils/sleep.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Orgad Shaneh . -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include "utils_global.h" - -namespace Utils { - -void QTCREATOR_UTILS_EXPORT sleep(int msec); - -} diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri index 7b22c547bde..fc7b552ff67 100644 --- a/src/libs/utils/utils-lib.pri +++ b/src/libs/utils/utils-lib.pri @@ -72,7 +72,6 @@ SOURCES += $$PWD/environment.cpp \ $$PWD/json.cpp \ $$PWD/portlist.cpp \ $$PWD/appmainwindow.cpp \ - $$PWD/sleep.cpp \ $$PWD/basetreeview.cpp \ $$PWD/qtcassert.cpp \ $$PWD/elfreader.cpp \ @@ -173,7 +172,6 @@ HEADERS += \ $$PWD/runextensions.h \ $$PWD/portlist.h \ $$PWD/appmainwindow.h \ - $$PWD/sleep.h \ $$PWD/basetreeview.h \ $$PWD/elfreader.h \ $$PWD/bracematcher.h \ diff --git a/src/libs/utils/utils.qbs b/src/libs/utils/utils.qbs index e22123019df..54a2f71b840 100644 --- a/src/libs/utils/utils.qbs +++ b/src/libs/utils/utils.qbs @@ -190,8 +190,6 @@ Project { "shellcommandpage.cpp", "shellcommandpage.h", "sizedarray.h", - "sleep.cpp", - "sleep.h", "smallstring.h", "smallstringiterator.h", "smallstringio.h", diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 01c2cc08ea7..10f436ae2fb 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include @@ -64,7 +63,9 @@ #include #include +#include #include +#include 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(); }