From 954f13545cfda26ea5a496a694cd81d28e09cc5e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 23 Jun 2023 10:12:15 +0200 Subject: [PATCH] QPollingFileSystemWatcherEngine: change PollingInterval to chrono::seconds More expressive and type-safe. Move it to the .cpp file (the only user) and make it static to avoid creating a non-namespaced symbol. Change-Id: Ib9b393e660e51c1791ed3a9a4a12e5c75736bf2a Reviewed-by: Qt CI Bot Reviewed-by: Volker Hilsheimer (cherry picked from commit a19585eee174dd593aa979e5232e9cca677bef44) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qfilesystemwatcher_polling.cpp | 7 +++++++ src/corelib/io/qfilesystemwatcher_polling_p.h | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_polling.cpp b/src/corelib/io/qfilesystemwatcher_polling.cpp index 6ec8b17ea45..a74205b713a 100644 --- a/src/corelib/io/qfilesystemwatcher_polling.cpp +++ b/src/corelib/io/qfilesystemwatcher_polling.cpp @@ -2,11 +2,18 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qfilesystemwatcher_polling_p.h" + #include #include +#include + +using namespace std::chrono_literals; + QT_BEGIN_NAMESPACE +static constexpr auto PollingInterval = 1s; + QPollingFileSystemWatcherEngine::QPollingFileSystemWatcherEngine(QObject *parent) : QFileSystemWatcherEngine(parent) { diff --git a/src/corelib/io/qfilesystemwatcher_polling_p.h b/src/corelib/io/qfilesystemwatcher_polling_p.h index b1100b061a1..b65ff055759 100644 --- a/src/corelib/io/qfilesystemwatcher_polling_p.h +++ b/src/corelib/io/qfilesystemwatcher_polling_p.h @@ -27,8 +27,6 @@ QT_REQUIRE_CONFIG(filesystemwatcher); QT_BEGIN_NAMESPACE -enum { PollingInterval = 1000 }; - class QPollingFileSystemWatcherEngine : public QFileSystemWatcherEngine { Q_OBJECT