Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5ccc32ec authored by Laurent Montel's avatar Laurent Montel 😁

Remove some gui code

parent 4c2a1b57
......@@ -39,7 +39,7 @@
int AbstractImportExportJob::sArchiveVersion = -1;
AbstractImportExportJob::AbstractImportExportJob(QWidget *parent, ArchiveStorage *archiveStorage, Utils::StoredTypes typeSelected, int numberOfStep)
AbstractImportExportJob::AbstractImportExportJob(QObject *parent, ArchiveStorage *archiveStorage, Utils::StoredTypes typeSelected, int numberOfStep)
: QObject(parent),
mTypeSelected(typeSelected),
mArchiveStorage(archiveStorage),
......@@ -49,8 +49,7 @@ AbstractImportExportJob::AbstractImportExportJob(QWidget *parent, ArchiveStorage
mNumberOfStep(numberOfStep),
mCreateResource(0),
mIndex(-1),
mImportExportProgressIndicator(new ImportExportProgressIndicatorBase(this)),
mParent(parent)
mImportExportProgressIndicator(new ImportExportProgressIndicatorBase(this))
{
mImportExportProgressIndicator->setNumberOfStep(numberOfStep);
connect(mImportExportProgressIndicator, SIGNAL(info(QString)), this, SIGNAL(info(QString)));
......
......@@ -18,11 +18,11 @@
#ifndef ABSTRACTIMPORTEXPORTJOB_H
#define ABSTRACTIMPORTEXPORTJOB_H
#include <QObject>
#include "utils.h"
#include <Akonadi/Collection>
#include <QStringList>
class QWidget;
class ArchiveStorage;
class KArchiveDirectory;
class KTempDir;
......@@ -43,7 +43,7 @@ class AbstractImportExportJob : public QObject
{
Q_OBJECT
public:
explicit AbstractImportExportJob(QWidget *parent, ArchiveStorage *archiveStorage, Utils::StoredTypes typeSelected, int numberOfStep);
explicit AbstractImportExportJob(QObject *parent, ArchiveStorage *archiveStorage, Utils::StoredTypes typeSelected, int numberOfStep);
~AbstractImportExportJob();
virtual void start() = 0;
......@@ -121,7 +121,6 @@ protected:
private:
ImportExportProgressIndicatorBase *mImportExportProgressIndicator;
QWidget *mParent;
};
#endif // ABSTRACTIMPORTEXPORTJOB_H
......@@ -30,7 +30,7 @@
#include <QDir>
ExportAddressbookJob::ExportAddressbookJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportAddressbookJob::ExportAddressbookJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportAddressbookJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportAddressbookJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportAddressbookJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportAddressbookJob();
void start();
......
......@@ -37,7 +37,7 @@ inline const QString storeAddressbook()
}
}
ImportAddressbookJob::ImportAddressbookJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportAddressbookJob::ImportAddressbookJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -28,7 +28,7 @@ class ImportAddressbookJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportAddressbookJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportAddressbookJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportAddressbookJob();
void start();
......
......@@ -28,7 +28,7 @@
#include <QWidget>
#include <QDir>
ExportAkregatorJob::ExportAkregatorJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportAkregatorJob::ExportAkregatorJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportAkregatorJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportAkregatorJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportAkregatorJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportAkregatorJob();
void start();
......
......@@ -26,7 +26,7 @@
#include <KGlobal>
#include <KStandardDirs>
ImportAkregatorJob::ImportAkregatorJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportAkregatorJob::ImportAkregatorJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -27,7 +27,7 @@ class ImportAkregatorJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportAkregatorJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportAkregatorJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportAkregatorJob();
void start();
......
......@@ -31,7 +31,7 @@
#include <QFile>
#include <QDir>
ExportAlarmJob::ExportAlarmJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportAlarmJob::ExportAlarmJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportAlarmJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportAlarmJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportAlarmJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportAlarmJob();
void start();
......
......@@ -37,7 +37,7 @@ inline const QString storeAlarm()
}
}
ImportAlarmJob::ImportAlarmJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportAlarmJob::ImportAlarmJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -27,7 +27,7 @@ class ImportAlarmJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportAlarmJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportAlarmJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportAlarmJob();
void start();
......
......@@ -27,7 +27,7 @@
#include <QWidget>
ExportBlogiloJob::ExportBlogiloJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportBlogiloJob::ExportBlogiloJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportBlogiloJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportBlogiloJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportBlogiloJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportBlogiloJob();
void start();
......
......@@ -26,7 +26,7 @@
#include <KStandardDirs>
#include <KZip>
ImportBlogiloJob::ImportBlogiloJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportBlogiloJob::ImportBlogiloJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -27,7 +27,7 @@ class ImportBlogiloJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportBlogiloJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportBlogiloJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportBlogiloJob();
void start();
......
......@@ -32,7 +32,7 @@
#include <QWidget>
ExportCalendarJob::ExportCalendarJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportCalendarJob::ExportCalendarJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
:AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportCalendarJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportCalendarJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportCalendarJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportCalendarJob();
void start();
......
......@@ -36,7 +36,7 @@ inline const QString storeCalendar()
}
}
ImportCalendarJob::ImportCalendarJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportCalendarJob::ImportCalendarJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -27,7 +27,7 @@ class ImportCalendarJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportCalendarJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportCalendarJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportCalendarJob();
void start();
......
......@@ -31,7 +31,7 @@
#include <QFile>
#include <QDir>
ExportJotJob::ExportJotJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportJotJob::ExportJotJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportJotJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportJotJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportJotJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportJotJob();
void start();
......
......@@ -35,7 +35,7 @@ inline const QString storeJot()
return QLatin1String("backupjot/");
}
}
ImportJotJob::ImportJotJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportJotJob::ImportJotJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -27,7 +27,7 @@ class ImportJotJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportJotJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportJotJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportJotJob();
void start();
......
......@@ -28,7 +28,7 @@
#include <QWidget>
#include <QDir>
ExportKnodeJob::ExportKnodeJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportKnodeJob::ExportKnodeJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportKnodeJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportKnodeJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportKnodeJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportKnodeJob();
void start();
......
......@@ -26,7 +26,7 @@
#include <KGlobal>
#include <KStandardDirs>
ImportKnodeJob::ImportKnodeJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportKnodeJob::ImportKnodeJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -27,7 +27,7 @@ class ImportKnodeJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportKnodeJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportKnodeJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportKnodeJob();
void start();
......
......@@ -40,7 +40,7 @@
#include <QFile>
#include <QDir>
ExportMailJob::ExportMailJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportMailJob::ExportMailJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent,archiveStorage,typeSelected,numberOfStep),
mArchiveTime(QDateTime::currentDateTime().toTime_t())
{
......
......@@ -29,7 +29,7 @@ class ArchiveStorage;
class ExportMailJob : public AbstractImportExportJob
{
public:
explicit ExportMailJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportMailJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportMailJob();
void start();
......
......@@ -56,7 +56,7 @@ inline const QString storeMails()
}
}
ImportMailJob::ImportMailJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportMailJob::ImportMailJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent,archiveStorage,typeSelected,numberOfStep)
{
initializeImportJob();
......
......@@ -31,7 +31,7 @@ class ImportMailJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportMailJob(QWidget *widget, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportMailJob(QObject *widget, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportMailJob();
void start();
......
......@@ -31,7 +31,7 @@
#include <QWidget>
#include <QDir>
ExportNotesJob::ExportNotesJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
ExportNotesJob::ExportNotesJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage,int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
}
......
......@@ -27,7 +27,7 @@ class ExportNotesJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ExportNotesJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ExportNotesJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportNotesJob();
void start();
......
......@@ -37,7 +37,7 @@ inline const QString backupnote()
}
}
ImportNotesJob::ImportNotesJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
ImportNotesJob::ImportNotesJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
{
initializeImportJob();
......
......@@ -27,7 +27,7 @@ class ImportNotesJob : public AbstractImportExportJob
{
Q_OBJECT
public:
explicit ImportNotesJob(QWidget *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
explicit ImportNotesJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportNotesJob();
void start();
......
......@@ -17,7 +17,7 @@
#include "pimsettingsbackuprestore.h"
#include "archivestorage.h"
#include "importexportprogressindicatorgui.h"
#include "importexportprogressindicatorbase.h"
#include "mail/exportmailjob.h"
#include "mail/importmailjob.h"
......@@ -53,9 +53,8 @@
#include <QDebug>
#include <QDateTime>
PimSettingsBackupRestore::PimSettingsBackupRestore(QWidget *parentWidget, QObject *parent)
PimSettingsBackupRestore::PimSettingsBackupRestore(QObject *parent)
: QObject(parent),
mParentWidget(parentWidget),
mImportExportData(0),
mArchiveStorage(0)
{
......@@ -113,55 +112,55 @@ void PimSettingsBackupRestore::backupNextStep()
switch(mStoreIterator.key()) {
case Utils::KMail:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportMailJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportMailJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KAddressBook:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportAddressbookJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportAddressbookJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KAlarm:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportAlarmJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportAlarmJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KOrganizer:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportCalendarJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportCalendarJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KJots:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportJotJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportJotJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KNotes:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportNotesJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportNotesJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::Akregator:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportAkregatorJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportAkregatorJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::Blogilo:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportBlogiloJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportBlogiloJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KNode:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ExportKnodeJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ExportKnodeJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
......@@ -194,55 +193,55 @@ void PimSettingsBackupRestore::restoreNextStep()
switch(mStoreIterator.key()) {
case Utils::KMail:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportMailJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportMailJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KAddressBook:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportAddressbookJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportAddressbookJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KAlarm:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportAlarmJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportAlarmJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KOrganizer:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportCalendarJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportCalendarJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KJots:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportJotJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportJotJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KNotes:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportNotesJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportNotesJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::Akregator:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportAkregatorJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportAkregatorJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::Blogilo:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportBlogiloJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportBlogiloJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
case Utils::KNode:
if (mStoreIterator.value().numberSteps != 0) {
mImportExportData = new ImportKnodeJob(mParentWidget, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
mImportExportData = new ImportKnodeJob(this, mStoreIterator.value().types, mArchiveStorage, mStoreIterator.value().numberSteps);
executeJob();
}
break;
......@@ -306,7 +305,7 @@ void PimSettingsBackupRestore::restoreFinished()
void PimSettingsBackupRestore::executeJob()
{
mImportExportData->setImportExportProgressIndicator(new ImportExportProgressIndicatorGui(mParentWidget, this));
addExportProgressIndicator();
connect(mImportExportData, SIGNAL(info(QString)), SIGNAL(addInfo(QString)));
connect(mImportExportData, SIGNAL(error(QString)), SIGNAL(addError(QString)));
connect(mImportExportData, SIGNAL(title(QString)), SIGNAL(addTitle(QString)));
......@@ -315,6 +314,11 @@ void PimSettingsBackupRestore::executeJob()
mImportExportData->start();
}
void PimSettingsBackupRestore::addExportProgressIndicator()
{
mImportExportData->setImportExportProgressIndicator(new ImportExportProgressIndicatorBase(this));
}
void PimSettingsBackupRestore::slotJobFinished()
{
++mStoreIterator;
......
......@@ -28,7 +28,7 @@ class PimSettingsBackupRestore : public QObject
{
Q_OBJECT
public:
explicit PimSettingsBackupRestore(QWidget *parentWidget, QObject *parent=0);
explicit PimSettingsBackupRestore(QObject *parent=0);
~PimSettingsBackupRestore();
void backupStart(const QString &filename);
......@@ -52,8 +52,9 @@ Q_SIGNALS:
protected:
virtual bool continueToRestore();
QWidget *mParentWidget;
virtual void addExportProgressIndicator();
AbstractImportExportJob *mImportExportData;
private:
enum Action {
Backup,
......@@ -69,7 +70,6 @@ private:
QHash<Utils::AppsType, Utils::importExportParameters> mStored;
QHash<Utils::AppsType, Utils::importExportParameters>::const_iterator mStoreIterator;
Action mAction;
AbstractImportExportJob *mImportExportData;
ArchiveStorage *mArchiveStorage;
};
......
......@@ -17,11 +17,14 @@
#include "pimsettingsbackuprestoreui.h"
#include "importexportprogressindicatorgui.h"
#include "abstractimportexportjob.h"
#include <KMessageBox>
#include <KLocalizedString>
PimSettingsBackupRestoreUI::PimSettingsBackupRestoreUI(QWidget *parentWidget, QObject *parent)
: PimSettingsBackupRestore(parentWidget, parent)
: PimSettingsBackupRestore(parent),
mParentWidget(parentWidget)
{
}
......@@ -37,3 +40,8 @@ bool PimSettingsBackupRestoreUI::continueToRestore()
return false;
return true;
}
void PimSettingsBackupRestoreUI::addExportProgressIndicator()
{
mImportExportData->setImportExportProgressIndicator(new ImportExportProgressIndicatorGui(mParentWidget, this));
}
......@@ -29,6 +29,9 @@ public:
protected:
virtual bool continueToRestore();
virtual void addExportProgressIndicator();
private:
QWidget *mParentWidget;
};
#endif // PIMSETTINGSBACKUPRESTOREUI_H
Markdown is supported
0% or