summaryrefslogtreecommitdiff
path: root/RealtimeSync/watcher.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:05:53 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:05:53 +0200
commit618dfb51d93898632830f1b87443d3f748780871 (patch)
treebac520a2e261154f8d35b0cb8aa345f5ab373811 /RealtimeSync/watcher.cpp
parent3.4 (diff)
downloadFreeFileSync-618dfb51d93898632830f1b87443d3f748780871.tar.gz
FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.tar.bz2
FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.zip
3.5
Diffstat (limited to 'RealtimeSync/watcher.cpp')
-rw-r--r--RealtimeSync/watcher.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/RealtimeSync/watcher.cpp b/RealtimeSync/watcher.cpp
index 2bb91b8a..3aa40520 100644
--- a/RealtimeSync/watcher.cpp
+++ b/RealtimeSync/watcher.cpp
@@ -31,6 +31,19 @@
using namespace FreeFileSync;
+bool RealtimeSync::updateUiIsAllowed()
+{
+ static wxLongLong lastExec = 0;
+ const wxLongLong newExec = wxGetLocalTimeMillis();
+
+ if (newExec - lastExec >= RealtimeSync::UI_UPDATE_INTERVAL) //perform ui updates not more often than necessary
+ {
+ lastExec = newExec;
+ return true;
+ }
+ return false;
+}
+
#ifdef FFS_WIN
/*
template <class T> //have a disctinct static variable per class!
@@ -216,6 +229,7 @@ private:
};
*/
+
//--------------------------------------------------------------------------------------------------------------
class ChangeNotifications
{
@@ -232,7 +246,7 @@ public:
arrayHandle.push_back(hndl);
}
- size_t getSize()
+ size_t getSize() const
{
return arrayHandle.size();
}
@@ -307,7 +321,7 @@ public:
}
private:
- std::map<Zstring, bool> availablility; //save avail. status for each directory
+ std::map<Zstring, bool> availablility; //save avail. status for each directory, avoid double-entries
};
bgstack15