diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-19 04:54:47 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-22 07:39:52 -0400 |
| commit | f49efd6d448dccd4100fa46e2ebf1690d97033cc (patch) | |
| tree | 700e4be020963a2cdd7ff13c4003c59efa064201 /src/organizercore.cpp | |
| parent | b3d0ddb0b75da4abd59cae1508d983945c8e235d (diff) | |
replaced formatSystemMessageQ() with formatSystemMessage()
replaced windowsErrorString() with formatSystemMessage()
Diffstat (limited to 'src/organizercore.cpp')
| -rw-r--r-- | src/organizercore.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index f6802673..b61ebde8 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -354,7 +354,7 @@ QString OrganizerCore::commitSettings(const QString &iniFile) // make a second attempt using qt functions but if that fails print the // error from the first attempt if (!renameFile(iniFile + ".new", iniFile)) { - return windowsErrorString(err); + return QString::fromStdWString(formatSystemMessage(err)); } } return QString(); @@ -387,10 +387,12 @@ void OrganizerCore::storeSettings() + QString::fromStdWString(AppConfig::iniFileName()); if (QFileInfo(iniFile).exists()) { if (!shellCopy(iniFile, iniFile + ".new", true, qApp->activeWindow())) { + const auto e = GetLastError(); QMessageBox::critical( qApp->activeWindow(), tr("Failed to write settings"), tr("An error occurred trying to update MO settings to %1: %2") - .arg(iniFile, windowsErrorString(::GetLastError()))); + .arg(iniFile) + .arg(QString::fromStdWString(formatSystemMessage(e)))); return; } } |
