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
This commit is contained in:
parent
d0ea5673ea
commit
9db98bb864
2 changed files with 3 additions and 4 deletions
|
@ -84,7 +84,7 @@ void BootloaderInstallFile::installStage2(void)
|
|||
m_tempfile.open();
|
||||
qDebug() << "[BootloaderInstallFile] renaming" << m_tempfile.fileName() << "to" << fwfile;
|
||||
m_tempfile.close();
|
||||
m_tempfile.rename(fwfile);
|
||||
m_tempfile.copy(fwfile);
|
||||
|
||||
emit logItem(tr("Bootloader successful installed"), LOGOK);
|
||||
logInstall(LogAdd);
|
||||
|
|
|
@ -61,7 +61,7 @@ void BootloaderInstallMi4::installStage2(void)
|
|||
m_tempfile.open();
|
||||
qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName() << "to" << fwfile;
|
||||
m_tempfile.close();
|
||||
m_tempfile.rename(fwfile);
|
||||
m_tempfile.copy(fwfile);
|
||||
|
||||
emit logItem(tr("Bootloader successful installed"), LOGOK);
|
||||
logInstall(LogAdd);
|
||||
|
@ -96,8 +96,7 @@ bool BootloaderInstallMi4::uninstall(void)
|
|||
QFile blfile(resolved);
|
||||
blfile.remove();
|
||||
|
||||
QFile oldbl(resolvePathCase(original));
|
||||
oldbl.rename(m_blfile);
|
||||
QFile::rename(resolvePathCase(original), m_blfile);
|
||||
emit logItem(tr("Rockbox bootloader successful removed"), LOGINFO);
|
||||
logInstall(LogRemove);
|
||||
emit done(false);
|
||||
|
|
Loading…
Reference in a new issue