From df199fa1503cce2fb5dec04d10a884832d2e7779 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Wed, 9 May 2018 14:47:27 +0500 Subject: [PATCH] UI: FortSettings: Improve error reporting. --- src/ui/fortsettings.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index ef7d199d..dddd83c4 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -197,8 +197,12 @@ bool FortSettings::writeConf(const FirewallConf &conf) return false; } - if (!(FileUtil::removeFile(filePath) - && FileUtil::copyFile(backupFilePath, filePath))) { + if (!FileUtil::removeFile(filePath)) { + setErrorMessage(tr("Can't remove .conf file")); + return false; + } + + if (!FileUtil::copyFile(backupFilePath, filePath)) { setErrorMessage(tr("Can't create .conf file")); return false; }