summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-11-08 21:17:13 +0100
committerMontel Laurent <[email protected]>2015-11-08 21:17:13 +0100
commita94db4ea9c4dacdf3d2d0a70fff2d5cdf01406dd (patch)
tree2715af5f4eea84faf0376c0351b5342572cc431b
parent584b59157ca142413d48a3466a82859c9cc8b898 (diff)
Make sure to close log file
-rw-r--r--pimsettingexporter/console/loginfile.cpp6
-rw-r--r--pimsettingexporter/console/pimsettingexporterconsole.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/pimsettingexporter/console/loginfile.cpp b/pimsettingexporter/console/loginfile.cpp
index 22beb7f..beabf93 100644
--- a/pimsettingexporter/console/loginfile.cpp
+++ b/pimsettingexporter/console/loginfile.cpp
@@ -83,13 +83,13 @@ void LogInFile::addLogLine(const QString &message, LogType type)
newMessage = QLatin1Char('\n');
break;
case AddInfo:
- newMessage = QStringLiteral("INFO: %1").arg(message);
+ newMessage = QStringLiteral("INFO: %1\n").arg(message);
break;
case AddError:
- newMessage = QStringLiteral("ERROR: %1").arg(message);
+ newMessage = QStringLiteral("ERROR: %1\n").arg(message);
break;
case AddTitle:
- newMessage = message;
+ newMessage = message + QLatin1Char('\n');
break;
}
mTextStream << newMessage;
diff --git a/pimsettingexporter/console/pimsettingexporterconsole.cpp b/pimsettingexporter/console/pimsettingexporterconsole.cpp
index ce4a4c2..ea1c600 100644
--- a/pimsettingexporter/console/pimsettingexporterconsole.cpp
+++ b/pimsettingexporter/console/pimsettingexporterconsole.cpp
@@ -65,18 +65,24 @@ void PimSettingExporterConsole::initializeLogInFile()
void PimSettingExporterConsole::slotRestoreDone()
{
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Restore Done";
+ delete mLogInFile;
+ mLogInFile = Q_NULLPTR;
QTimer::singleShot(0, this, &PimSettingExporterConsole::finished);
}
void PimSettingExporterConsole::slotJobFailed()
{
qCWarning(PIMSETTINGEXPORTERCONSOLE_LOG) << "job failed";
+ delete mLogInFile;
+ mLogInFile = Q_NULLPTR;
mPimSettingsBackupRestore->closeArchive();
}
void PimSettingExporterConsole::slotBackupDone()
{
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Backup Done";
+ delete mLogInFile;
+ mLogInFile = Q_NULLPTR;
QTimer::singleShot(0, this, &PimSettingExporterConsole::finished);
}