merge QFileSystemWatcherEngine into QFileSystemWatcherEngineUnix

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-11-15 09:31:42 +02:00
parent ec45dcff28
commit d772f70c77
3 changed files with 8 additions and 31 deletions

View file

@ -298,7 +298,6 @@ QStringList QFileSystemWatcher::files() const
QT_END_NAMESPACE
#include "moc_qfilesystemwatcher.h"
#include "moc_qfilesystemwatcher_p.h"
#endif // QT_NO_FILESYSTEMWATCHER

View file

@ -38,38 +38,12 @@
#ifndef QT_NO_FILESYSTEMWATCHER
#include "qobject_p.h"
#include "qfilesystemwatcher_unix_p.h"
#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
class QFileSystemWatcherEngine : public QObject
{
Q_OBJECT
protected:
inline QFileSystemWatcherEngine()
{
}
public:
// fills \a files and \a directories with the \a paths it could
// watch, and returns a list of paths this engine could not watch
virtual QStringList addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories) = 0;
// removes \a paths from \a files and \a directories, and returns
// a list of paths this engine does not know about (either addPath
// failed or wasn't called)
virtual QStringList removePaths(const QStringList &paths,
QStringList *files,
QStringList *directories) = 0;
Q_SIGNALS:
void fileChanged(const QString &path, bool removed);
void directoryChanged(const QString &path, bool removed);
};
class QFileSystemWatcherPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QFileSystemWatcher)
@ -78,7 +52,7 @@ public:
QFileSystemWatcherPrivate();
void init();
QFileSystemWatcherEngine *watcher;
QFileSystemWatcherEngineUnix *watcher;
QStringList files, directories;
// private slots

View file

@ -33,7 +33,7 @@
// We mean it.
//
#include "qfilesystemwatcher_p.h"
#include "qglobal.h"
#ifndef QT_NO_FILESYSTEMWATCHER
@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
class QFileSystemWatcherEngineUnix : public QFileSystemWatcherEngine
class QFileSystemWatcherEngineUnix : public QObject
{
Q_OBJECT
@ -60,6 +60,10 @@ public:
QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories);
QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories);
Q_SIGNALS:
void fileChanged(const QString &path, bool removed);
void directoryChanged(const QString &path, bool removed);
private Q_SLOTS:
void timeout();