Qt 6.x
The Qt SDK
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
4#ifndef QFILESYSTEMWATCHER_P_H
5#define QFILESYSTEMWATCHER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qfilesystemwatcher.h"
19
20QT_REQUIRE_CONFIG(filesystemwatcher);
21
22#include <private/qobject_p.h>
23
24#include <QtCore/qstringlist.h>
25#include <QtCore/qhash.h>
26
28
30{
32
33protected:
36 {
37 }
38
39public:
40 // fills \a files and \a directories with the \a paths it could
41 // watch, and returns a list of paths this engine could not watch
44 QStringList *directories) = 0;
45 // removes \a paths from \a files and \a directories, and returns
46 // a list of paths this engine does not know about (either addPath
47 // failed or wasn't called)
50 QStringList *directories) = 0;
51
53 void fileChanged(const QString &path, bool removed);
54 void directoryChanged(const QString &path, bool removed);
55};
56
58{
59 Q_DECLARE_PUBLIC(QFileSystemWatcher)
60
61 static QFileSystemWatcherEngine *createNativeEngine(QObject *parent);
62
63public:
65 void init();
66 void initPollerEngine();
67
70
71 // private slots
72 void _q_fileChanged(const QString &path, bool removed);
73 void _q_directoryChanged(const QString &path, bool removed);
74
75#if defined(Q_OS_WIN)
76 void _q_winDriveLockForRemoval(const QString &);
77 void _q_winDriveLockForRemovalFailed(const QString &);
78 void _q_winDriveRemoved(const QString &);
79
80private:
81 QHash<QChar, QStringList> temporarilyRemovedPaths;
82#endif // Q_OS_WIN
83};
84
85
87#endif // QFILESYSTEMWATCHER_P_H
QFileSystemWatcherEngine(QObject *parent)
virtual QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories)=0
virtual QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories)=0
void directoryChanged(const QString &path, bool removed)
void fileChanged(const QString &path, bool removed)
QFileSystemWatcherEngine * native
void _q_fileChanged(const QString &path, bool removed)
QFileSystemWatcherEngine * poller
void _q_directoryChanged(const QString &path, bool removed)
\inmodule QtCore
Definition qhash.h:818
QObject * parent
Definition qobject.h:61
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Combined button and popup list for selecting options.
GLsizei const GLuint * paths
GLsizei const GLchar *const * path
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define Q_SIGNALS
QStringList files
[8]