summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-04-10 20:33:15 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-04-10 20:37:29 +0200
commitdebe77a567cc630f7e72388a965d5db0bbfd53d4 (patch)
tree2cdaf37361cbbad183e4d5d816aef3b32f2b6d37 /rbutil/rbutilqt/base/bootloaderinstallhex.cpp
parent2406005d8f8c54a9fe11d74c2bed99e656930fc8 (diff)
downloadrockbox-debe77a567cc630f7e72388a965d5db0bbfd53d4.tar.gz
rockbox-debe77a567cc630f7e72388a965d5db0bbfd53d4.tar.bz2
rockbox-debe77a567cc630f7e72388a965d5db0bbfd53d4.zip
Check for existing firmware file on H100 / H300.
Show an error if copying the firmware file to the player failed. Also, check if there is already a firmware file present on the player. If so abort and tell the user about it, since QFile::copy() doesn't overwrite existing files and the user might not expect the file to get overwritten. Change-Id: Ie63963289965900a4ab519ddf128246f89d81c6c
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallhex.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallhex.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
index 3ff9c70936..3fdfba6c8a 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
@@ -19,6 +19,7 @@
#include <QtCore>
#include "bootloaderinstallbase.h"
#include "bootloaderinstallhex.h"
+#include "utils.h"
#include "../../tools/iriver.h"
#include "../../tools/mkboot.h"
@@ -209,9 +210,20 @@ void BootloaderInstallHex::installStage2(void)
return;
}
// finally copy file to player
- targethex.copy(m_blfile);
+ if(!Utils::resolvePathCase(m_blfile).isEmpty()) {
+ emit logItem(tr("A firmware file is already present on player"), LOGERROR);
+ emit done(true);
+ return;
+ }
+ if(targethex.copy(m_blfile)) {
+ emit logItem(tr("Success: modified firmware file created"), LOGINFO);
+ }
+ else {
+ emit logItem(tr("Copying modified firmware file failed"), LOGERROR);
+ emit done(true);
+ return;
+ }
- emit logItem(tr("Success: modified firmware file created"), LOGINFO);
logInstall(LogAdd);
emit done(false);