From 32339addbf42041edece07e0fe180a42aaf56d48 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Sat, 22 Aug 2015 22:53:13 +0100 Subject: Fix nasty message when starting MO for first time --- src/organizercore.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') 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"); -- cgit v1.3.1