From f7d91a01d1040b3ec5574fad6146d06038657f60 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 16 Mar 2020 12:28:07 +0100 Subject: QmakeProjectManager: Use delay timer from base class Change-Id: I38b55efc34b34b58430d1d665eb6672c3de89b4f Reviewed-by: hjk --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 14 +++++--------- src/plugins/qmakeprojectmanager/qmakeproject.h | 2 -- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/plugins/qmakeprojectmanager') diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 14fd924665..15040d8f94 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -73,6 +73,7 @@ #include #include #include +#include using namespace QmakeProjectManager::Internal; using namespace ProjectExplorer; @@ -187,9 +188,7 @@ QmakeBuildSystem::QmakeBuildSystem(QmakeBuildConfiguration *bc) const QTextCodec *codec = Core::EditorManager::defaultTextCodec(); m_qmakeVfs->setTextCodec(codec); - m_asyncUpdateTimer.setSingleShot(true); - m_asyncUpdateTimer.setInterval(0); - connect(&m_asyncUpdateTimer, &QTimer::timeout, this, &QmakeBuildSystem::asyncUpdate); + setParseDelay(0); m_rootProFile = std::make_unique(this, projectFilePath()); @@ -497,13 +496,10 @@ void QmakeBuildSystem::startAsyncTimer(QmakeProFile::AsyncUpdateDelay delay) return; } - const int interval = qMin(m_asyncUpdateTimer.interval(), + const int interval = qMin(parseDelay(), delay == QmakeProFile::ParseLater ? UPDATE_INTERVAL : 0); qCDebug(qmakeBuildSystemLog) << __FUNCTION__ << interval; - - m_asyncUpdateTimer.stop(); - m_asyncUpdateTimer.setInterval(interval); - m_asyncUpdateTimer.start(); + requestParseWithCustomDelay(interval); } void QmakeBuildSystem::incrementPendingEvaluateFutures() @@ -564,7 +560,7 @@ bool QmakeBuildSystem::wasEvaluateCanceled() void QmakeBuildSystem::asyncUpdate() { - m_asyncUpdateTimer.setInterval(UPDATE_INTERVAL); + setParseDelay(UPDATE_INTERVAL); qCDebug(qmakeBuildSystemLog) << __FUNCTION__; if (m_invalidateQmakeVfsContents) { diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index 4abc5309c5..c25dfcc32d 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -35,7 +35,6 @@ #include #include -#include #include QT_BEGIN_NAMESPACE @@ -189,7 +188,6 @@ public: QString m_qmakeSysroot; - QTimer m_asyncUpdateTimer; QFutureInterface m_asyncUpdateFutureInterface; int m_pendingEvaluateFuturesCount = 0; AsyncUpdateState m_asyncUpdateState = Base; -- cgit v1.2.3