aboutsummaryrefslogtreecommitdiffstats
path: root/src/watcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/watcher.h')
-rw-r--r--src/watcher.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/watcher.h b/src/watcher.h
index a17e28a..434f552 100644
--- a/src/watcher.h
+++ b/src/watcher.h
@@ -37,20 +37,35 @@ class Watcher : public QObject
{
Q_OBJECT
public:
+ enum Error {
+ NoError,
+ MaximumReached,
+ SystemError,
+ };
+
explicit Watcher(QObject *parent = 0);
void setDirectory(const QString& path);
QString directory() const;
+ bool hasError() const { return m_error != NoError; }
+ Error error() const { return m_error; }
+ static int maximumWatches() { return s_maximumWatches; }
+ static void setMaximumWatches(int maximumWatches);
private Q_SLOTS:
void recordChange(const QString &path);
void notifyChanges();
Q_SIGNALS:
void directoriesChanged(const QStringList& changes);
-
+ void errorChanged();
private:
void addDirectoriesRecursively(const QString& path);
+ void addDirectory(const QString &path);
+ void removeAllPaths();
+ void setError(Error error);
+ static int s_maximumWatches;
QFileSystemWatcher *m_watcher;
QDir m_rootDir;
QTimer *m_waitTimer;
QStringList m_changes;
+ Error m_error = NoError;
};