diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-04-10 20:33:15 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-04-10 20:37:29 +0200 |
commit | debe77a567cc630f7e72388a965d5db0bbfd53d4 (patch) | |
tree | 2cdaf37361cbbad183e4d5d816aef3b32f2b6d37 /rbutil | |
parent | 2406005d8f8c54a9fe11d74c2bed99e656930fc8 (diff) | |
download | rockbox-debe77a567cc630f7e72388a965d5db0bbfd53d4.tar.gz 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')
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallhex.cpp | 16 |
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 @@ | |||
19 | #include <QtCore> | 19 | #include <QtCore> |
20 | #include "bootloaderinstallbase.h" | 20 | #include "bootloaderinstallbase.h" |
21 | #include "bootloaderinstallhex.h" | 21 | #include "bootloaderinstallhex.h" |
22 | #include "utils.h" | ||
22 | 23 | ||
23 | #include "../../tools/iriver.h" | 24 | #include "../../tools/iriver.h" |
24 | #include "../../tools/mkboot.h" | 25 | #include "../../tools/mkboot.h" |
@@ -209,9 +210,20 @@ void BootloaderInstallHex::installStage2(void) | |||
209 | return; | 210 | return; |
210 | } | 211 | } |
211 | // finally copy file to player | 212 | // finally copy file to player |
212 | targethex.copy(m_blfile); | 213 | if(!Utils::resolvePathCase(m_blfile).isEmpty()) { |
214 | emit logItem(tr("A firmware file is already present on player"), LOGERROR); | ||
215 | emit done(true); | ||
216 | return; | ||
217 | } | ||
218 | if(targethex.copy(m_blfile)) { | ||
219 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); | ||
220 | } | ||
221 | else { | ||
222 | emit logItem(tr("Copying modified firmware file failed"), LOGERROR); | ||
223 | emit done(true); | ||
224 | return; | ||
225 | } | ||
213 | 226 | ||
214 | emit logItem(tr("Success: modified firmware file created"), LOGINFO); | ||
215 | logInstall(LogAdd); | 227 | logInstall(LogAdd); |
216 | emit done(false); | 228 | emit done(false); |
217 | 229 | ||