summaryrefslogtreecommitdiffstats
path: root/rbutil/bootloaders.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-03-20 15:38:48 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-03-20 15:38:48 +0000
commit22a673062ffdffc9048ca10193fd93d4c24039a7 (patch)
treef96ab2f4679f782268ae42df7bb078de7200ce58 /rbutil/bootloaders.cpp
parent2671b6cda62e43015c5914844c03dbbc53aafb31 (diff)
downloadrockbox-22a673062ffdffc9048ca10193fd93d4c24039a7.tar.gz
rockbox-22a673062ffdffc9048ca10193fd93d4c24039a7.zip
Fix more Warnings, and also a bug with checking the dirstructure for themes in rbutil
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12862 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/bootloaders.cpp')
-rwxr-xr-xrbutil/bootloaders.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/rbutil/bootloaders.cpp b/rbutil/bootloaders.cpp
index 5a58f3b14b..d424a4f35e 100755
--- a/rbutil/bootloaders.cpp
+++ b/rbutil/bootloaders.cpp
@@ -194,19 +194,17 @@ bool gigabeatf(int mode)
}
path2 = path1;
path2.Append(wxT(".ORIG"));
- if(wxFileExists(path2))
+ if(!wxFileExists(path2))
{
- err = wxT("Its seems there is already a Bootloader install, if not, delete the *.IMG.ORIG file");
- ERR_DIALOG(err, wxT("Bootloader add"));
- return false;
+ if(!wxRenameFile(path1,path2,false))
+ {
+ err.Printf(wxT("[ERR] Coud not rename %s to %s"),path1.c_str(),path2.c_str());
+ ERR_DIALOG(err, wxT("Bootloader add"));
+ return false;
+ }
}
- if(!wxRenameFile(path1,path2,false))
- {
- err.Printf(wxT("[ERR] Coud not rename %s to %s"),path1.c_str(),path2.c_str());
- ERR_DIALOG(err, wxT("Bootloader add"));
- return false;
- }
+
if(!wxCopyFile(dest,path1))
{
err.Printf(wxT("[ERR] Coud not copy %s to %s"),dest.c_str(),path2.c_str());
@@ -300,7 +298,7 @@ bool h10(int mode)
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
- path1.Printf(wxT("%sSYSTEM" PATH_SEP "H10EMP.mi4")); //attempt other firmwarename
+ path1.Printf(wxT("%sSYSTEM" PATH_SEP "H10EMP.mi4"),gv->curdestdir.c_str()); //attempt other firmwarename
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
err.Printf(wxT("[ERR] File %s does not Exist"),path1.c_str());
@@ -308,18 +306,16 @@ bool h10(int mode)
return false;
}
}
- if(wxFileExists(path2)) //there is already a original firmware
- {
- err.Printf(wxT("[ERR2] File %s does Exist"),path2.c_str());
- ERR_DIALOG(err, wxT("Bootloader add"));
- return false;
- }
- if(!wxRenameFile(path1,path2,false)) //rename Firmware to Original
+ if(!wxFileExists(path2)) //there is already a original firmware
{
- err.Printf(wxT("[ERR] Coud not rename %s to %s"),path1.c_str(),path2.c_str());
- ERR_DIALOG(err, wxT("Bootloader add"));
- return false;
+ if(!wxRenameFile(path1,path2,false)) //rename Firmware to Original
+ {
+ err.Printf(wxT("[ERR] Coud not rename %s to %s"),path1.c_str(),path2.c_str());
+ ERR_DIALOG(err, wxT("Bootloader add"));
+ return false;
+ }
}
+
if(!wxCopyFile(dest,path1)) // copy file
{
err.Printf(wxT("[ERR] Coud not copy %s to %s"),dest.c_str(),path1.c_str());
@@ -336,7 +332,7 @@ bool h10(int mode)
path2.Printf(wxT("%sSYSTEM" PATH_SEP "Original.mi4"),gv->curdestdir.c_str());
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
- path1.Printf(wxT("%s" PATH_SEP "SYSTEM" PATH_SEP "H10EMP.mi4")); //attempt other firmwarename
+ path1.Printf(wxT("%s" PATH_SEP "SYSTEM" PATH_SEP "H10EMP.mi4"),gv->curdestdir.c_str()); //attempt other firmwarename
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
err.Printf(wxT("[ERR] File %s does not Exist"),path1.c_str());