From a19585eee174dd593aa979e5232e9cca677bef44 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. Pick-to: 6.6 Change-Id: Ib9b393e660e51c1791ed3a9a4a12e5c75736bf2a Reviewed-by: Qt CI Bot Reviewed-by: Volker Hilsheimer --- 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 6ec8b17ea4..a74205b713 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 b1100b061a..b65ff05575 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