summaryrefslogtreecommitdiff
path: root/src/syncevo
diff options
context:
space:
mode:
Diffstat (limited to 'src/syncevo')
-rw-r--r--src/syncevo/SyncContext.cpp3
-rw-r--r--src/syncevo/SyncContext.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/syncevo/SyncContext.cpp b/src/syncevo/SyncContext.cpp
index a0344fa3..54964837 100644
--- a/src/syncevo/SyncContext.cpp
+++ b/src/syncevo/SyncContext.cpp
@@ -1768,6 +1768,8 @@ void SyncContext::displaySourceProgress(sysync::TProgressEventEnum type,
source.recordFirstSync(extra1 == 2);
source.recordResumeSync(extra2 == 1);
} else if (SyncMode(mode) != SYNC_NONE) {
+ // Broadcast statistics before moving into next cycle.
+ m_sourceSyncedSignal(source.getName(), source);
// may happen when the source is used in multiple
// SyncML sessions; only remember the initial sync
// mode in that case and count all following syncs
@@ -3234,6 +3236,7 @@ SyncMLStatus SyncContext::sync(SyncReport *report)
// but some items failed, we report a "partial failure"
// status.
BOOST_FOREACH(SyncSource *source, sourceList) {
+ m_sourceSyncedSignal(source->getName(), *source);
if (source->getStatus() == STATUS_OK &&
(source->getItemStat(SyncSource::ITEM_LOCAL,
SyncSource::ITEM_ANY,
diff --git a/src/syncevo/SyncContext.h b/src/syncevo/SyncContext.h
index 4a4e1bfc..8269c24f 100644
--- a/src/syncevo/SyncContext.h
+++ b/src/syncevo/SyncContext.h
@@ -159,6 +159,12 @@ class SyncContext : public SyncConfig {
static InitMainSignal &GetInitMainSignal();
/**
+ * A signal invoked each time a source has gone through a sync cycle.
+ */
+ typedef boost::signals2::signal<void (const std::string &name, const SyncSourceReport &source)> SourceSyncedSignal;
+ SourceSyncedSignal m_sourceSyncedSignal;
+
+ /**
* true if binary was compiled as stable release
* (see gen-autotools.sh)
*/