~ci-train-bot/sync-monitor/sync-monitor-ubuntu-yakkety-landing-053

« back to all changes in this revision

Viewing changes to src/sync-dbus.cpp

  • Committer: CI Train Bot
  • Author(s): Renato Araujo Oliveira Filho
  • Date: 2016-04-19 19:32:27 UTC
  • mfrom: (58.1.8 last-sync-property)
  • Revision ID: ci-train-bot@canonical.com-20160419193227-7zthaqsx3bsyx0lf
Export the last successful sync data.
Approved by: Arthur Mello

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    updateState();
37
37
}
38
38
 
 
39
bool SyncDBus::syncOnMobileConnection() const
 
40
{
 
41
    return m_parent->syncOnMobileConnection();
 
42
}
 
43
 
 
44
void SyncDBus::setSyncOnMobileConnection(bool flag)
 
45
{
 
46
    m_parent->setSyncOnMobileConnection(flag);
 
47
}
 
48
 
39
49
void SyncDBus::sync(QStringList services)
40
50
{
41
51
    if (services.isEmpty()) {
42
 
        m_parent->syncAll(QString(), true);
 
52
        m_parent->syncAll(QString(), true, true);
43
53
    } else {
44
54
        Q_FOREACH(const QString &service, services) {
45
 
            m_parent->syncAll(service, true);
 
55
            m_parent->syncAll(service, true, true);
46
56
        }
47
57
    }
48
58
}
95
105
    Q_EMIT clientDeattached(m_clientCount);
96
106
}
97
107
 
 
108
QString SyncDBus::lastSuccessfulSyncDate(quint32 accountId, const QString &service, const QDBusMessage &message)
 
109
{
 
110
    message.setDelayedReply(true);
 
111
 
 
112
    QString result = m_parent->lastSuccessfulSyncDate(accountId, service);
 
113
    qDebug() << "Result" << result;
 
114
    QDBusMessage reply = message.createReply(QVariant::fromValue<QString>(result));
 
115
    QDBusConnection::sessionBus().send(reply);
 
116
    return result;
 
117
}
 
118
 
98
119
void SyncDBus::onSyncStarted(SyncAccount *syncAcc, const QString &serviceName)
99
120
{
100
121
    updateState();