summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-03-15 21:21:04 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-03-15 21:21:04 +0000
commit9db98bb864c969cdbffd7081e49994ca31cc3084 (patch)
tree025d9c14a2036752fd86fe52dc7ec72c2efa6f3f
parentd0ea5673ea3af8b90c67f9f4982d9bd45ee0ca48 (diff)
downloadrockbox-9db98bb864c969cdbffd7081e49994ca31cc3084.tar.gz
rockbox-9db98bb864c969cdbffd7081e49994ca31cc3084.zip
Fix bootloader files vanishing after installation (FS#11086).
QTemporaryFile creates temporary files, so they might get removed even if they are renamed. Copy the downloaded temporary file instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25208 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallfile.cpp2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallmi4.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
index 0db39a5be3..2e7061036d 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
@@ -84,7 +84,7 @@ void BootloaderInstallFile::installStage2(void)
84 m_tempfile.open(); 84 m_tempfile.open();
85 qDebug() << "[BootloaderInstallFile] renaming" << m_tempfile.fileName() << "to" << fwfile; 85 qDebug() << "[BootloaderInstallFile] renaming" << m_tempfile.fileName() << "to" << fwfile;
86 m_tempfile.close(); 86 m_tempfile.close();
87 m_tempfile.rename(fwfile); 87 m_tempfile.copy(fwfile);
88 88
89 emit logItem(tr("Bootloader successful installed"), LOGOK); 89 emit logItem(tr("Bootloader successful installed"), LOGOK);
90 logInstall(LogAdd); 90 logInstall(LogAdd);
diff --git a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
index 8ae872d5ab..936ad175c3 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp
@@ -61,7 +61,7 @@ void BootloaderInstallMi4::installStage2(void)
61 m_tempfile.open(); 61 m_tempfile.open();
62 qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName() << "to" << fwfile; 62 qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName() << "to" << fwfile;
63 m_tempfile.close(); 63 m_tempfile.close();
64 m_tempfile.rename(fwfile); 64 m_tempfile.copy(fwfile);
65 65
66 emit logItem(tr("Bootloader successful installed"), LOGOK); 66 emit logItem(tr("Bootloader successful installed"), LOGOK);
67 logInstall(LogAdd); 67 logInstall(LogAdd);
@@ -96,8 +96,7 @@ bool BootloaderInstallMi4::uninstall(void)
96 QFile blfile(resolved); 96 QFile blfile(resolved);
97 blfile.remove(); 97 blfile.remove();
98 98
99 QFile oldbl(resolvePathCase(original)); 99 QFile::rename(resolvePathCase(original), m_blfile);
100 oldbl.rename(m_blfile);
101 emit logItem(tr("Rockbox bootloader successful removed"), LOGINFO); 100 emit logItem(tr("Rockbox bootloader successful removed"), LOGINFO);
102 logInstall(LogRemove); 101 logInstall(LogRemove);
103 emit done(false); 102 emit done(false);