From f91f3f36102a209d456ae224040b762b80efb96c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 20 Aug 2013 21:02:02 +0200 Subject: [PATCH] Softupdate/applySettigs: No rename/copy file when update_dir=/tmp --- src/gui/update_ext.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index 6bbaa2ee1..5deeb5ea7 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -158,15 +158,18 @@ bool CExtUpdate::applySettings(std::string & filename, int mode) std::string timeStr = getNowTimeStr("_%Y%m%d_%H%M"); std::string settingsStr = "+settings"; - if (g_settings.softupdate_name_mode_apply == CExtUpdate::SOFTUPDATE_NAME_HOSTNAME_TIME) - imgFilename = orgPath + "/" + hostName + timeStr + settingsStr + orgExt; - else if (g_settings.softupdate_name_mode_apply == CExtUpdate::SOFTUPDATE_NAME_ORGNAME_TIME) - imgFilename = orgPath + "/" + orgName + timeStr + settingsStr + orgExt; + if (orgPath != "/tmp") { + if (g_settings.softupdate_name_mode_apply == CExtUpdate::SOFTUPDATE_NAME_HOSTNAME_TIME) + imgFilename = orgPath + "/" + hostName + timeStr + settingsStr + orgExt; + else if (g_settings.softupdate_name_mode_apply == CExtUpdate::SOFTUPDATE_NAME_ORGNAME_TIME) + imgFilename = orgPath + "/" + orgName + timeStr + settingsStr + orgExt; + else + imgFilename = orgPath + "/" + orgName + settingsStr + orgExt; + FileHelpers->copyFile(oldFilename.c_str(), imgFilename.c_str(), 0644); + } else - imgFilename = orgPath + "/" + orgName + settingsStr + orgExt; - + imgFilename = oldFilename; filename = imgFilename; - FileHelpers->copyFile(oldFilename.c_str(), imgFilename.c_str(), 0644); bool ret = applySettings(); DBG_TIMER_STOP("Image editing")