summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-11-06 08:07:31 +0100
committerMontel Laurent <[email protected]>2015-11-06 08:07:31 +0100
commit1788a7ff94ed0269fc90026fe428825fe0afde15 (patch)
tree6cb998fbfe3ffa82cf5fc099845a8378daebab75
parentf0c07b5f853e3240435f8b3f82ee85706d7088cc (diff)
Continue to implement fullsync
-rw-r--r--pimsettingexporter/core/synchronizeresourcejob.cpp5
-rw-r--r--pimsettingexporter/core/synchronizeresourcejob.h3
-rw-r--r--pimsettingexporter/gui/fullsynchronizeresourcesjob.cpp23
-rw-r--r--pimsettingexporter/gui/fullsynchronizeresourcesjob.h6
4 files changed, 35 insertions, 2 deletions
diff --git a/pimsettingexporter/core/synchronizeresourcejob.cpp b/pimsettingexporter/core/synchronizeresourcejob.cpp
index cb31348..62e0cbc 100644
--- a/pimsettingexporter/core/synchronizeresourcejob.cpp
+++ b/pimsettingexporter/core/synchronizeresourcejob.cpp
@@ -76,3 +76,8 @@ void SynchronizeResourceJob::setListResources(const QStringList &resources)
mListResources = resources;
}
+void SynchronizeResourceJob::setSynchronizeOnlyCollection(bool onlyCollection)
+{
+ mOnlyCollection = onlyCollection;
+}
+
diff --git a/pimsettingexporter/core/synchronizeresourcejob.h b/pimsettingexporter/core/synchronizeresourcejob.h
index dcf0138..b4605d1 100644
--- a/pimsettingexporter/core/synchronizeresourcejob.h
+++ b/pimsettingexporter/core/synchronizeresourcejob.h
@@ -20,8 +20,9 @@
#include <QObject>
#include <QStringList>
+#include "pimsettingexporter_export.h"
class KJob;
-class SynchronizeResourceJob : public QObject
+class PIMSETTINGEXPORTER_EXPORT SynchronizeResourceJob : public QObject
{
Q_OBJECT
public:
diff --git a/pimsettingexporter/gui/fullsynchronizeresourcesjob.cpp b/pimsettingexporter/gui/fullsynchronizeresourcesjob.cpp
index d0b74e5..45e08de 100644
--- a/pimsettingexporter/gui/fullsynchronizeresourcesjob.cpp
+++ b/pimsettingexporter/gui/fullsynchronizeresourcesjob.cpp
@@ -18,6 +18,8 @@
#include "fullsynchronizeresourcesjob.h"
+#include <synchronizeresourcejob.h>
+
FullSynchronizeResourcesJob::FullSynchronizeResourcesJob(QObject *parent)
: QObject(parent),
mWindowParent(Q_NULLPTR)
@@ -47,5 +49,24 @@ void FullSynchronizeResourcesJob::setWindowParent(QWidget *parent)
void FullSynchronizeResourcesJob::start()
{
- //TODO
+ SynchronizeResourceJob *job = new SynchronizeResourceJob(this);
+ //Full synch
+ job->setSynchronizeOnlyCollection(false);
+ job->setListResources(mResources);
+ connect(job, &SynchronizeResourceJob::synchronizationFinished, this, &FullSynchronizeResourcesJob::synchronizeFinished);
+ connect(job, &SynchronizeResourceJob::synchronizationInstanceDone, this, &FullSynchronizeResourcesJob::slotSynchronizeInstanceDone);
+ connect(job, &SynchronizeResourceJob::synchronizationInstanceFailed, this, &FullSynchronizeResourcesJob::slotSynchronizeInstanceFailed);
+ job->start();
+}
+
+void FullSynchronizeResourcesJob::slotSynchronizeInstanceDone(const QString &identifier)
+{
+ Q_EMIT synchronizeInstanceDone(identifier);
+ //TODO increase progress indicator
+}
+
+void FullSynchronizeResourcesJob::slotSynchronizeInstanceFailed(const QString &identifier)
+{
+ Q_EMIT synchronizeInstanceFailed(identifier);
+ //TODO increase progress indicator
}
diff --git a/pimsettingexporter/gui/fullsynchronizeresourcesjob.h b/pimsettingexporter/gui/fullsynchronizeresourcesjob.h
index 61eaa8e..297abb1 100644
--- a/pimsettingexporter/gui/fullsynchronizeresourcesjob.h
+++ b/pimsettingexporter/gui/fullsynchronizeresourcesjob.h
@@ -36,6 +36,12 @@ public:
void start();
Q_SIGNALS:
void synchronizeFinished();
+ void synchronizeInstanceDone(const QString &instance);
+ void synchronizeInstanceFailed(const QString &instance);
+
+private Q_SLOTS:
+ void slotSynchronizeInstanceFailed(const QString &identifier);
+ void slotSynchronizeInstanceDone(const QString &identifier);
private:
QStringList mResources;