summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-11-07 16:20:31 +0100
committerMontel Laurent <[email protected]>2015-11-07 16:20:31 +0100
commitb17bb9a8e461abaeacdcecb7125e021c85921d83 (patch)
tree0b0b0e5266cc7530d1803e90138ec705cea8aad1
parent9e0158d7e3002998712afe186a35e52ca7aefcae (diff)
Add debug + exit application
-rw-r--r--pimsettingexporter/console/main.cpp5
-rw-r--r--pimsettingexporter/console/pimsettingexporterconsole.cpp10
-rw-r--r--pimsettingexporter/core/pimsettingsbackuprestore.cpp2
3 files changed, 15 insertions, 2 deletions
diff --git a/pimsettingexporter/console/main.cpp b/pimsettingexporter/console/main.cpp
index 16b73a5..94f06ae 100644
--- a/pimsettingexporter/console/main.cpp
+++ b/pimsettingexporter/console/main.cpp
@@ -17,6 +17,7 @@
#include "kdepim-version.h"
#include "pimsettingexporterconsole.h"
+#include "pimsettingexportconsole_debug.h"
#include <kaboutdata.h>
#include <KLocalizedString>
@@ -60,17 +61,21 @@ int main(int argc, char *argv[])
QString templateFile;
if (parser.isSet(QStringLiteral("template"))) {
templateFile = parser.value(QStringLiteral("template"));
+ qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Template file " << templateFile;
}
if (parser.isSet(QStringLiteral("logfile"))) {
logFile = parser.value(QStringLiteral("logfile"));
+ qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Log file " << logFile;
}
PimSettingExporterConsole *console = new PimSettingExporterConsole;
if (!importFile.isEmpty()) {
console->setMode(PimSettingExporterConsole::Import);
+ qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Import Mode" << importFile;
console->setImportExportFileName(importFile);
} else if (!exportFile.isEmpty()) {
console->setMode(PimSettingExporterConsole::Export);
+ qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Export Mode" << exportFile;
console->setImportExportFileName(exportFile);
}
if (!logFile.isEmpty()) {
diff --git a/pimsettingexporter/console/pimsettingexporterconsole.cpp b/pimsettingexporter/console/pimsettingexporterconsole.cpp
index bf62c8c..ed3f583 100644
--- a/pimsettingexporter/console/pimsettingexporterconsole.cpp
+++ b/pimsettingexporter/console/pimsettingexporterconsole.cpp
@@ -122,10 +122,16 @@ void PimSettingExporterConsole::start()
}
switch (mMode) {
case Import:
- mPimSettingsBackupRestore->restoreStart(mImportExportFileName);
+ if (!mPimSettingsBackupRestore->restoreStart(mImportExportFileName)) {
+ qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Unable to start restore.";
+ Q_EMIT finished();
+ }
break;
case Export:
- mPimSettingsBackupRestore->backupStart(mImportExportFileName);
+ if (!mPimSettingsBackupRestore->backupStart(mImportExportFileName)) {
+ qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Unable to start backup.";
+ Q_EMIT finished();
+ }
break;
}
}
diff --git a/pimsettingexporter/core/pimsettingsbackuprestore.cpp b/pimsettingexporter/core/pimsettingsbackuprestore.cpp
index a1acc07..2bb6e75 100644
--- a/pimsettingexporter/core/pimsettingsbackuprestore.cpp
+++ b/pimsettingexporter/core/pimsettingsbackuprestore.cpp
@@ -79,7 +79,9 @@ bool PimSettingsBackupRestore::openArchive(const QString &filename, bool readWri
bool PimSettingsBackupRestore::backupStart(const QString &filename)
{
+ qDebug()<<" bool PimSettingsBackupRestore::backupStart(const QString &filename)" << mStored.isEmpty();
if (mStored.isEmpty()) {
+
addDate();
Q_EMIT addInfo(i18n("No data selected."));
Q_EMIT jobFailed();