diff options
| author | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-08-22 22:53:13 +0100 |
|---|---|---|
| committer | Tom Tanner <thosrtanner2@users.sourceforge.net> | 2015-08-22 22:53:13 +0100 |
| commit | 32339addbf42041edece07e0fe180a42aaf56d48 (patch) | |
| tree | eff08d307747a77acc2ee68cdcacd2e7f887f5c7 /src | |
| parent | dd875c05de81a3f96d8942fa57dcdaf593f71a06 (diff) | |
Fix nasty message when starting MO for first time
Diffstat (limited to 'src')
| -rw-r--r-- | src/organizercore.cpp | 12 |
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");
|
