summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-11-06 13:18:36 +0100
committerMontel Laurent <[email protected]>2015-11-06 14:03:34 +0100
commit9c1dbc70d1a7c75a3d93a504f581edb672ddb786 (patch)
treeaf3931707edd7ff876c4074e7e22ec8715b6e53b
parentdc02766a614d1e4156b3bc0c6dc2e479f0711f0b (diff)
Fix full sync
-rw-r--r--pimsettingexporter/core/abstractimportexportjob.cpp6
-rw-r--r--pimsettingexporter/core/abstractimportexportjob.h4
-rw-r--r--pimsettingexporter/core/pimsettingsbackuprestore.h2
-rw-r--r--pimsettingexporter/core/synchronizeresourcejob.cpp2
-rw-r--r--pimsettingexporter/core/synchronizeresourcejob.h2
-rw-r--r--pimsettingexporter/gui/pimsettingexporterwindow.cpp5
-rw-r--r--pimsettingexporter/gui/pimsettingexporterwindow.h2
7 files changed, 13 insertions, 10 deletions
diff --git a/pimsettingexporter/core/abstractimportexportjob.cpp b/pimsettingexporter/core/abstractimportexportjob.cpp
index 93c87ef..e270708 100644
--- a/pimsettingexporter/core/abstractimportexportjob.cpp
+++ b/pimsettingexporter/core/abstractimportexportjob.cpp
@@ -478,10 +478,10 @@ void AbstractImportExportJob::slotSynchronizeInstanceFailed(const QString &insta
Q_EMIT error(i18n("Failed to synchronize %1.", instance));
}
-void AbstractImportExportJob::slotSynchronizeInstanceDone(const QString &instance)
+void AbstractImportExportJob::slotSynchronizeInstanceDone(const QString &name, const QString &identifier)
{
- Q_EMIT info(i18n("Resource %1 synchronized.", instance));
- Q_EMIT needSynchronizeResource(instance);
+ Q_EMIT info(i18n("Resource %1 synchronized.", name));
+ Q_EMIT needSynchronizeResource(name, identifier);
}
void AbstractImportExportJob::slotAllResourceSynchronized()
diff --git a/pimsettingexporter/core/abstractimportexportjob.h b/pimsettingexporter/core/abstractimportexportjob.h
index c4c21d0..b6e9e00 100644
--- a/pimsettingexporter/core/abstractimportexportjob.h
+++ b/pimsettingexporter/core/abstractimportexportjob.h
@@ -66,12 +66,12 @@ Q_SIGNALS:
void error(const QString &);
void title(const QString &);
void endLine();
- void needSynchronizeResource(const QString &identifier);
+ void needSynchronizeResource(const QString &name, const QString &identifier);
void jobFinished();
private Q_SLOTS:
void slotAllResourceSynchronized();
- void slotSynchronizeInstanceDone(const QString &);
+ void slotSynchronizeInstanceDone(const QString &, const QString &identifier);
void slotSynchronizeInstanceFailed(const QString &instance);
void slotTaskCanceled();
diff --git a/pimsettingexporter/core/pimsettingsbackuprestore.h b/pimsettingexporter/core/pimsettingsbackuprestore.h
index 48c700a..57fe325 100644
--- a/pimsettingexporter/core/pimsettingsbackuprestore.h
+++ b/pimsettingexporter/core/pimsettingsbackuprestore.h
@@ -51,7 +51,7 @@ Q_SIGNALS:
void backupDone();
void restoreDone();
void jobFailed();
- void needSyncResource(const QString &identifier);
+ void needSyncResource(const QString &name, const QString &identifier);
protected:
virtual bool continueToRestore();
diff --git a/pimsettingexporter/core/synchronizeresourcejob.cpp b/pimsettingexporter/core/synchronizeresourcejob.cpp
index f9fec88..e1b3f22 100644
--- a/pimsettingexporter/core/synchronizeresourcejob.cpp
+++ b/pimsettingexporter/core/synchronizeresourcejob.cpp
@@ -66,7 +66,7 @@ void SynchronizeResourceJob::slotSynchronizationFinished(KJob *job)
if (job->error()) {
Q_EMIT synchronizationInstanceFailed(instanceName);
} else {
- Q_EMIT synchronizationInstanceDone(instanceName);
+ Q_EMIT synchronizationInstanceDone(instanceName, resourceSync->resource().identifier());
}
++mIndex;
QTimer::singleShot(0, this, &SynchronizeResourceJob::slotNextSync);
diff --git a/pimsettingexporter/core/synchronizeresourcejob.h b/pimsettingexporter/core/synchronizeresourcejob.h
index 73338b1..b22ba31 100644
--- a/pimsettingexporter/core/synchronizeresourcejob.h
+++ b/pimsettingexporter/core/synchronizeresourcejob.h
@@ -35,7 +35,7 @@ public:
Q_SIGNALS:
void synchronizationFinished();
- void synchronizationInstanceDone(const QString &);
+ void synchronizationInstanceDone(const QString &name, const QString &identifier);
void synchronizationInstanceFailed(const QString &);
private Q_SLOTS:
diff --git a/pimsettingexporter/gui/pimsettingexporterwindow.cpp b/pimsettingexporter/gui/pimsettingexporterwindow.cpp
index afa84f3..ef141c5 100644
--- a/pimsettingexporter/gui/pimsettingexporterwindow.cpp
+++ b/pimsettingexporter/gui/pimsettingexporterwindow.cpp
@@ -98,8 +98,9 @@ void PimSettingExporterWindow::initializeBackupRestoreUi()
connect(mPimSettingsBackupRestoreUI, &PimSettingsBackupRestore::restoreDone, this, &PimSettingExporterWindow::slotRestoreDone);
}
-void PimSettingExporterWindow::slotAddResourceToSync(const QString &identifier)
+void PimSettingExporterWindow::slotAddResourceToSync(const QString &name, const QString &identifier)
{
+ Q_UNUSED(name);
mNeedToSyncResources << identifier;
}
@@ -124,6 +125,7 @@ void PimSettingExporterWindow::slotRestoreDone()
}
delete dlg;
if (!list.isEmpty()) {
+ slotAddInfo(i18n("Full sync starts..."));
FullSynchronizeResourcesJob *job = new FullSynchronizeResourcesJob(this);
job->setWindowParent(this);
job->setResources(list);
@@ -145,6 +147,7 @@ void PimSettingExporterWindow::slotShowBackupFinishDialogInformation()
void PimSettingExporterWindow::slotFullSyncFinished()
{
slotUpdateActions(false);
+ slotAddInfo(i18n("Full sync finished."));
}
void PimSettingExporterWindow::slotFullSyncInstanceDone(const QString &identifier)
diff --git a/pimsettingexporter/gui/pimsettingexporterwindow.h b/pimsettingexporter/gui/pimsettingexporterwindow.h
index bfc1838..47048f0 100644
--- a/pimsettingexporter/gui/pimsettingexporterwindow.h
+++ b/pimsettingexporter/gui/pimsettingexporterwindow.h
@@ -49,7 +49,7 @@ private Q_SLOTS:
void slotJobFailed();
void slotJobFinished();
void slotShowCurrentArchiveInformations();
- void slotAddResourceToSync(const QString &identifier);
+ void slotAddResourceToSync(const QString &name, const QString &identifier);
void slotFullSyncFinished();
void slotFullSyncInstanceDone(const QString &identifier);
void slotFullSyncInstanceFailed(const QString &identifier);