Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Mac-Vicar P <duncan@kde.org>2011-04-04 20:41:14 +0400
committerDuncan Mac-Vicar P <duncan@kde.org>2011-04-04 20:41:14 +0400
commit4e45cab2c1631f9202f0ac19d53c002b8d4cd90e (patch)
treeadad527cde682533d2a699e32b1abcdaa085d397 /src/mirall/folderwatcher.h
parent389507d92f51346eeffce64f9a41195843811420 (diff)
- lot of stability improvements
- the crash with threads goes away by using QMap - add a polling timer
Diffstat (limited to 'src/mirall/folderwatcher.h')
-rw-r--r--src/mirall/folderwatcher.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mirall/folderwatcher.h b/src/mirall/folderwatcher.h
index 5c3442747..6ca9acf03 100644
--- a/src/mirall/folderwatcher.h
+++ b/src/mirall/folderwatcher.h
@@ -3,6 +3,7 @@
#ifndef MIRALL_FOLDERWATCHER_H
#define MIRALL_FOLDERWATCHER_H
+#include <QList>
#include <QObject>
#include <QString>
#include <QStringList>
@@ -43,6 +44,14 @@ public:
QString root() const;
/**
+ * Add an ignore pattern that will not be
+ * notified
+ *
+ * You can use wildcards
+ */
+ void addIgnore(const QString &pattern);
+
+ /**
* If true, folderChanged() events are sent
* at least as often as eventInterval() seconds.
*/
@@ -67,6 +76,19 @@ public:
*/
void setEventInterval(int seconds);
+ /**
+ * The minimum amounts of seconds to wait before
+ * doing a full sync to see if the remote changed
+ */
+ int pollInterval() const;
+
+ /**
+ * Sets minimum amounts of seconds that will separate
+ * poll intervals
+ */
+ void setPollInterval(int seconds);
+
+
signals:
/**
* Emitted when one of the paths is changed
@@ -81,20 +103,29 @@ protected slots:
void slotAddFolderRecursive(const QString &path);
// called when the manually process timer triggers
void slotProcessTimerTimeout();
+ void slotPollTimerTimeout();
void slotProcessPaths();
+
private:
bool _eventsEnabled;
int _eventInterval;
+ int _pollInterval;
+
INotify *_inotify;
QString _root;
// paths pending to notified
QStringList _pendingPaths;
+
QTimer *_processTimer;
+ // poll timer for remote syncs
+ QTimer *_pollTimer;
+
QTime _lastEventTime;
// to cancel events that belong to the same action
int _lastMask;
QString _lastPath;
+ QStringList _ignores;
};
}