summaryrefslogtreecommitdiff
path: root/rbutil/rbutil.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-02-21 20:27:14 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-02-21 20:27:14 +0000
commite863d595b50867c550d53cd9d92032fcbb82ef3c (patch)
tree2f21dc466248a72c897305fc6c6f182eb692ca2c /rbutil/rbutil.cpp
parenta5e0380d9045c3a075ad633fef981f4a4ae82f14 (diff)
Implementation of Bootloader installation/uninstallation for all Targets in rbUtil. Needs testing. FS#6643
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12439 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutil.cpp')
-rw-r--r--rbutil/rbutil.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/rbutil/rbutil.cpp b/rbutil/rbutil.cpp
index b7a1fa6a73..9ffe9a6c58 100644
--- a/rbutil/rbutil.cpp
+++ b/rbutil/rbutil.cpp
@@ -21,28 +21,29 @@
#include "rbutil.h"
#include "installlog.h"
+
// This class allows us to return directories as well as files to
// wxDir::Traverse
class wxDirTraverserIncludeDirs : public wxDirTraverser
- {
- public:
- wxDirTraverserIncludeDirs(wxArrayString& files) : m_files(files) { }
+{
+public:
+ wxDirTraverserIncludeDirs(wxArrayString& files) : m_files(files) { }
- virtual wxDirTraverseResult OnFile(const wxString& filename)
- {
- m_files.Add(filename);
- return wxDIR_CONTINUE;
- }
+ virtual wxDirTraverseResult OnFile(const wxString& filename)
+ {
+ m_files.Add(filename);
+ return wxDIR_CONTINUE;
+ }
- virtual wxDirTraverseResult OnDir(const wxString& dirname)
- {
- m_files.Add(dirname);
- return wxDIR_CONTINUE;
- }
+ virtual wxDirTraverseResult OnDir(const wxString& dirname)
+ {
+ m_files.Add(dirname);
+ return wxDIR_CONTINUE;
+ }
- private:
- wxArrayString& m_files;
- };
+private:
+ wxArrayString& m_files;
+};
wxDEFINE_SCOPED_PTR_TYPE(wxZipEntry);
@@ -272,18 +273,15 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
in_str.Printf(wxT("%s" PATH_SEP "%s"), destdir.c_str(), name.c_str());
if (entry->IsDir() ) {
- wxDir* dirname = new wxDir(in_str);
- if (! dirname->Exists(in_str) ) {
+ if (!wxDirExists(in_str) ) {
if (! wxMkdir(in_str, 0777) ) {
buf.Printf(_("Unable to create directory %s"),
in_str.c_str() );
errnum = 100;
- delete dirname;
break;
}
}
log->WriteFile(name, true); // Directory
- delete dirname;
continue;
}