summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2008-02-28 20:18:40 +0000
committerDominik Wenger <domonoky@googlemail.com>2008-02-28 20:18:40 +0000
commit86a9baf1dc5478657628232a56b54ab3a0936d16 (patch)
tree145da2c588bc502398589c8a26ad7587a78c0782 /rbutil/rbutilqt
parent00b722ff22ffc298da4dafb5c4de301eb0ee027b (diff)
rbutil: make a backup of the OF in gigabeat and h10 bootloader installation. (in /<homedir>/Gigabeat Original Firmware Backup/ or /<homedir>/Iriver H10 Original Firmware Backup/).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16446 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/installbootloader.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/rbutil/rbutilqt/installbootloader.cpp b/rbutil/rbutilqt/installbootloader.cpp
index 7c6867ecbd..61655fd1f3 100644
--- a/rbutil/rbutilqt/installbootloader.cpp
+++ b/rbutil/rbutilqt/installbootloader.cpp
@@ -378,10 +378,15 @@ void BootloaderInstaller::gigabeatFinish()
firmwareOrig.append(".ORIG");
QFileInfo firmwareOrigFI(firmwareOrig);
- // rename the firmware, if there is no original firmware there
+ // rename and backup the firmware, if there is no original firmware there
if(!firmwareOrigFI.exists())
{
QFile firmwareFile(firmware);
+ //backup
+ QDir::home().mkdir("Gigabeat Original Firmware Backup");
+ firmwareFile.copy(QDir::toNativeSeparators(QDir::homePath()) + QDir::toNativeSeparators("/Gigabeat Original Firmware Backup/") + m_bootloadername);
+
+ //rename
if(!firmwareFile.rename(firmwareOrig))
{
m_dp->addItem(tr("Could not rename: %1 to %2")
@@ -589,9 +594,15 @@ void BootloaderInstaller::h10Finish()
QFileInfo firmwareOrigFI(firmwareOrig);
- if(!firmwareOrigFI.exists()) //there is already a original firmware
+ if(!firmwareOrigFI.exists())
{
QFile firmwareFile(firmware);
+
+ //backup
+ QDir::home().mkdir("Iriver H10 Original Firmware Backup");
+ firmwareFile.copy(QDir::toNativeSeparators(QDir::homePath()) + QDir::toNativeSeparators("/Iriver H10 Original Firmware Backup/") + m_bootloadername);
+
+ //rename
if(!firmwareFile.rename(firmwareOrig)) //rename Firmware to Original
{
m_dp->addItem(tr("Could not rename: %1 to %2")
@@ -600,7 +611,7 @@ void BootloaderInstaller::h10Finish()
return;
}
}
- else
+ else //there is already a original firmware
{
QFile firmwareFile(firmware);
firmwareFile.remove();