summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Tanner <thosrtanner2@users.sourceforge.net>2015-08-22 22:53:13 +0100
committerTom Tanner <thosrtanner2@users.sourceforge.net>2015-08-22 22:53:13 +0100
commit32339addbf42041edece07e0fe180a42aaf56d48 (patch)
treeeff08d307747a77acc2ee68cdcacd2e7f887f5c7 /src
parentdd875c05de81a3f96d8942fa57dcdaf593f71a06 (diff)
Fix nasty message when starting MO for first time
Diffstat (limited to 'src')
-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");