From b6b75de59ba284b0497e450d2bbe76523d1ee523 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 7 May 2013 16:39:50 +0200 Subject: PIM: new return value for SyncPeer(), new SyncProgress signal (FDO #63417) The SyncPeer() result is derived from the sync statistics. To have them available, the "sync done" signal must include the SyncReport. Start and end of a sync could already be detected; "modified" signals while a sync runs depends on a new signal inside the SyncContext when switching from one cycle to the next and at the end of the last one. --- src/dbus/server/session-helper.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/dbus/server/session-helper.cpp') diff --git a/src/dbus/server/session-helper.cpp b/src/dbus/server/session-helper.cpp index 4507576f..b84d85ca 100644 --- a/src/dbus/server/session-helper.cpp +++ b/src/dbus/server/session-helper.cpp @@ -125,6 +125,7 @@ SessionHelper::SessionHelper(GMainLoop *loop, emitLogOutput(*this, "LogOutput"), emitSyncProgress(*this, "SyncProgress"), emitSourceProgress(*this, "SourceProgress"), + emitSourceSynced(*this, "SourceSynced"), emitWaiting(*this, "Waiting"), emitSyncSuccessStart(*this, "SyncSuccessStart"), emitConfigChanged(*this, "ConfigChanged"), @@ -141,6 +142,7 @@ SessionHelper::SessionHelper(GMainLoop *loop, add(emitLogOutput); add(emitSyncProgress); add(emitSourceProgress); + add(emitSourceSynced); add(emitWaiting); add(emitSyncSuccessStart); add(emitConfigChanged); @@ -184,18 +186,19 @@ bool SessionHelper::connected() } void SessionHelper::sync(const SessionCommon::SyncParams ¶ms, - const boost::shared_ptr< GDBusCXX::Result1 > &result) + const boost::shared_ptr< GDBusCXX::Result2 > &result) { m_operation = boost::bind(&SessionHelper::doSync, this, params, result); g_main_loop_quit(m_loop); } bool SessionHelper::doSync(const SessionCommon::SyncParams ¶ms, - const boost::shared_ptr< GDBusCXX::Result1 > &result) + const boost::shared_ptr< GDBusCXX::Result2 > &result) { try { m_sync.reset(new DBusSync(params, *this)); - SyncMLStatus status = m_sync->sync(); + SyncReport report; + SyncMLStatus status = m_sync->sync(&report); if (status) { // Clear the abort signal, to allow the process to send // out the D-Bus response. Our parent will signal us again @@ -205,7 +208,7 @@ bool SessionHelper::doSync(const SessionCommon::SyncParams ¶ms, "sync failed", status); } - result->done(true); + result->done(true, report); } catch (...) { dbusErrorCallback(result); } -- cgit v1.2.3