summaryrefslogtreecommitdiff
path: root/process_callback.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
commitc8e0e909b4a8d18319fc65434a10dc446434817c (patch)
treeeee91e7d2ce229dd043811eae8f1e2bd78061916 /process_callback.h
parent5.2 (diff)
downloadFreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip
5.3
Diffstat (limited to 'process_callback.h')
-rw-r--r--process_callback.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/process_callback.h b/process_callback.h
index 77b2987f..c7681bb0 100644
--- a/process_callback.h
+++ b/process_callback.h
@@ -11,24 +11,26 @@
#include <zen/int64.h>
//interface for comparison and synchronization process status updates (used by GUI or Batch mode)
-
+const int UI_UPDATE_INTERVAL = 100; //unit: [ms]; perform ui updates not more often than necessary,
+//100 seems to be a good value with only a minimal performance loss; also used by Win 7 copy progress bar
+//this one is required by async directory existence check!
//report status during comparison and synchronization
struct ProcessCallback
{
virtual ~ProcessCallback() {}
- //identifiers of different phases
- enum Process
+ //these methods have to be implemented in the derived classes to handle error and status information
+
+ //notify synchronization phases
+ enum Phase
{
- PROCESS_NONE = 10,
- PROCESS_SCANNING,
- PROCESS_COMPARING_CONTENT,
- PROCESS_SYNCHRONIZING
+ PHASE_NONE, //initial status
+ PHASE_SCANNING,
+ PHASE_COMPARING_CONTENT,
+ PHASE_SYNCHRONIZING
};
-
- //these methods have to be implemented in the derived classes to handle error and status information
- virtual void initNewProcess(int objectsTotal, zen::Int64 dataTotal, Process processID) = 0; //informs about the total amount of data that will be processed from now on
+ virtual void initNewPhase(int objectsTotal, zen::Int64 dataTotal, Phase phaseId) = 0; //informs about the total amount of data that will be processed in this phase
//note: this one must NOT throw in order to properly allow undoing setting of statistics!
//it is in general paired with a call to requestUiRefresh() to compensate!
@@ -36,11 +38,12 @@ struct ProcessCallback
virtual void updateTotalData (int objectsDelta, zen::Int64 dataDelta) = 0; //
/*the estimated total may change *during* sync:
1. move file -> fallback to copy + delete
- 2. file copy, actual size changed after comparison
+ 2. file copy, actual size changed after comparison or file contains significant ADS data
3. auto-resolution for failed create operations due to missing source
4. directory deletion: may contain more items than scanned by FFS: excluded by filter
5. delete directory to recycler or move to user-defined dir on same volume: no matter how many sub-elements exist, this is only 1 object to process!
- 6. user-defined deletion directory on different volume: full file copy required (instead of move) */
+ 6. user-defined deletion directory on different volume: full file copy required (instead of move)
+ 7. Copy sparse files */
//opportunity to abort must be implemented in a frequently executed method like requestUiRefresh()
virtual void requestUiRefresh() = 0; //throw ?
bgstack15