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 43c99c21 authored by Laurent Montel's avatar Laurent Montel 😁

Use directly mPimSettingsBackupRestoreUI

parent 18b0f7b1
......@@ -22,10 +22,8 @@
#include "utils.h"
#include "pimsettingexporter_export.h"
class LogWidget;
class AbstractImportExportJob;
class KRecentFilesAction;
class KUrl;
class ArchiveStorage;
class KAction;
class PimSettingsBackupRestoreUI;
......@@ -38,7 +36,6 @@ public:
void handleCommandLine();
private Q_SLOTS:
void slotJobFinished();
void slotBackupData();
void slotRestoreData();
void slotAddInfo(const QString &info);
......@@ -53,29 +50,13 @@ private Q_SLOTS:
void slotShowBackupFinishDialogInformation();
void slotJobFailed();
private:
enum Action {
Backup,
Restore
};
void initializeBackupRestoreUi();
void backupNextStep();
void restoreNextStep();
void backupFinished();
void backupStart();
void restoreFinished();
void restoreStart();
void backupData(const QString &filename, const QString &templateFile = QString());
void loadData(const QString &filename, const QString &templateFile = QString());
void executeJob();
bool canZip() const;
void setupActions(bool canZipFile);
QHash<Utils::AppsType, Utils::importExportParameters> mStored;
QHash<Utils::AppsType, Utils::importExportParameters>::const_iterator mStoreIterator;
Action mAction;
LogWidget *mLogWidget;
AbstractImportExportJob *mImportExportData;
KRecentFilesAction *mRecentFilesAction;
ArchiveStorage *mArchiveStorage;
KAction *mBackupAction;
KAction *mRestoreAction;
KAction *mSaveLogAction;
......
......@@ -82,17 +82,17 @@ bool PimSettingsBackupRestore::openArchive(const QString &filename, bool readWri
return true;
}
void PimSettingsBackupRestore::backupStart(const QString &filename)
bool PimSettingsBackupRestore::backupStart(const QString &filename)
{
if (mStored.isEmpty()) {
Q_EMIT jobFailed();
deleteLater();
return;
return false;
}
if (!openArchive(filename, true)) {
Q_EMIT jobFailed();
deleteLater();
return;
return false;
}
Q_EMIT updateActions(true);
mAction = Backup;
......@@ -104,6 +104,7 @@ void PimSettingsBackupRestore::backupStart(const QString &filename)
//Add version
Utils::addVersion(mArchiveStorage->archive());
backupNextStep();
return true;
}
void PimSettingsBackupRestore::backupNextStep()
......
......@@ -31,7 +31,7 @@ public:
explicit PimSettingsBackupRestore(QObject *parent=0);
~PimSettingsBackupRestore();
void backupStart(const QString &filename);
bool backupStart(const QString &filename);
bool restoreStart(const QString &filename);
void setStoredParameters(const QHash<Utils::AppsType, Utils::importExportParameters> &stored);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment