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 <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Marc Mutz 2023-06-23 10:12:15 +02:00
parent 22858ffced
commit a19585eee1
2 changed files with 7 additions and 2 deletions

View File

@ -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 <QtCore/qscopeguard.h>
#include <QtCore/qtimer.h>
#include <chrono>
using namespace std::chrono_literals;
QT_BEGIN_NAMESPACE
static constexpr auto PollingInterval = 1s;
QPollingFileSystemWatcherEngine::QPollingFileSystemWatcherEngine(QObject *parent)
: QFileSystemWatcherEngine(parent)
{

View File

@ -27,8 +27,6 @@
QT_REQUIRE_CONFIG(filesystemwatcher);
QT_BEGIN_NAMESPACE
enum { PollingInterval = 1000 };
class QPollingFileSystemWatcherEngine : public QFileSystemWatcherEngine
{
Q_OBJECT