From b77b1a38bdccf055d61cbe8ab42ca8b0a30b8b05 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 20 Aug 2013 20:38:51 +0200 Subject: [PATCH] Softupdate: Fix filename for local update Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b12442b5de2517522f3c5e087a2f686210f0955 Author: Michael Liebmann Date: 2013-08-20 (Tue, 20 Aug 2013) --- src/gui/update.cpp | 3 ++- src/gui/update_ext.cpp | 3 ++- src/gui/update_ext.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index b48f13325..b1920827a 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -757,7 +757,8 @@ int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey) showFileSelector(""); } else { if(selectedMTD == 10) { - CExtUpdate::getInstance()->applySettings(actionKey, CExtUpdate::MODE_EXPERT); + std::string aK = actionKey; + CExtUpdate::getInstance()->applySettings(aK, CExtUpdate::MODE_EXPERT); } else if(selectedMTD==-1) { writemtd(actionKey, MTD_OF_WHOLE_IMAGE); diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index a629c9664..6bbaa2ee1 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -137,7 +137,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str return false; } -bool CExtUpdate::applySettings(const std::string & filename, int mode) +bool CExtUpdate::applySettings(std::string & filename, int mode) { if(!FileHelpers) FileHelpers = new CFileHelpers(); @@ -165,6 +165,7 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode) else imgFilename = orgPath + "/" + orgName + settingsStr + orgExt; + filename = imgFilename; FileHelpers->copyFile(oldFilename.c_str(), imgFilename.c_str(), 0644); bool ret = applySettings(); diff --git a/src/gui/update_ext.h b/src/gui/update_ext.h index d42f3d9a3..de3b07d65 100644 --- a/src/gui/update_ext.h +++ b/src/gui/update_ext.h @@ -90,7 +90,7 @@ class CExtUpdate ~CExtUpdate(); static CExtUpdate* getInstance(); - bool applySettings(const std::string & filename, int mode); + bool applySettings(std::string & filename, int mode); bool ErrorReset(bool modus, const std::string & msg1="", const std::string & msg2=""); bool isBlacklistEntry(const std::string & file);