summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/organizercore.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index cea1a868..fe19bb90 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -244,11 +244,13 @@ QSettings::Status OrganizerCore::storeSettings(const QString &fileName)
void OrganizerCore::storeSettings()
{
QString iniFile = qApp->property("dataPath").toString() + "/" + QString::fromStdWString(AppConfig::iniFileName());
- if (!shellCopy(iniFile, iniFile + ".new", true, qApp->activeWindow())) {
- QMessageBox::critical(qApp->activeWindow(), tr("Failed to write settings"),
- tr("An error occured trying to update MO settings to %1: %2").arg(
- iniFile, windowsErrorString(::GetLastError())));
- return;
+ if (QFileInfo(iniFile).exists()) {
+ if (!shellCopy(iniFile, iniFile + ".new", true, qApp->activeWindow())) {
+ QMessageBox::critical(qApp->activeWindow(), tr("Failed to write settings"),
+ tr("An error occured trying to update MO settings to %1: %2").arg(
+ iniFile, windowsErrorString(::GetLastError())));
+ return;
+ }
}
QSettings::Status result = storeSettings(iniFile + ".new");