Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfilesystemwatcher_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QFILESYSTEMWATCHER_P_H
6#define QFILESYSTEMWATCHER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20
22
23#include <private/qobject_p.h>
24
25#include <QtCore/qstringlist.h>
26#include <QtCore/qhash.h>
27
28QT_BEGIN_NAMESPACE
29
30class QFileSystemWatcherEngine : public QObject
31{
32 Q_OBJECT
33
34protected:
35 inline QFileSystemWatcherEngine(QObject *parent)
36 : QObject(parent)
37 {
38 }
39
40public:
41 // fills \a files and \a directories with the \a paths it could
42 // watch, and returns a list of paths this engine could not watch
43 virtual QStringList addPaths(const QStringList &paths,
44 QStringList *files,
45 QStringList *directories) = 0;
46 // removes \a paths from \a files and \a directories, and returns
47 // a list of paths this engine does not know about (either addPath
48 // failed or wasn't called)
49 virtual QStringList removePaths(const QStringList &paths,
50 QStringList *files,
51 QStringList *directories) = 0;
52
53Q_SIGNALS:
54 void fileChanged(const QString &path, bool removed);
55 void directoryChanged(const QString &path, bool removed);
56};
57
59{
60 Q_DECLARE_PUBLIC(QFileSystemWatcher)
61
63
64public:
66 void init();
67 void initPollerEngine();
68
69 QFileSystemWatcherEngine *native, *poller;
71
72 // private slots
73 void fileChanged(const QString &path, bool removed);
74 void directoryChanged(const QString &path, bool removed);
75
76 void connectEngine(QFileSystemWatcherEngine *e);
77
78#if defined(Q_OS_WIN)
79 void winDriveLockForRemoval(const QString &);
81 void winDriveRemoved(const QString &);
82
83private:
85#endif // Q_OS_WIN
86};
87
88
89QT_END_NAMESPACE
90#endif // QFILESYSTEMWATCHER_P_H
void connectEngine(QFileSystemWatcherEngine *e)
void fileChanged(const QString &path, bool removed)
QFileSystemWatcherEngine * native
QFileSystemWatcherEngine * poller
void directoryChanged(const QString &path, bool removed)
QT_REQUIRE_CONFIG(animation)
static QStringList empty_paths_pruned(const QStringList &paths)
QT_REQUIRE_CONFIG(filesystemwatcher)
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)