diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-04-02 21:24:19 +0000 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-04-02 21:24:19 +0000 |
| commit | 9fedc8187f746960ea4608f7bb9e5e9b2667fd39 (patch) | |
| tree | b4290364c67a0a8b9b201472a3e9d5790b73b0ba /rbutil/rbutilqt/base/bootloaderinstallfile.cpp | |
| parent | c5d9516a68923fa863ea7984a985fce23e263ada (diff) | |
| download | rockbox-9fedc8187f746960ea4608f7bb9e5e9b2667fd39.zip rockbox-9fedc8187f746960ea4608f7bb9e5e9b2667fd39.tar.gz rockbox-9fedc8187f746960ea4608f7bb9e5e9b2667fd39.tar.bz2 rockbox-9fedc8187f746960ea4608f7bb9e5e9b2667fd39.tar.xz | |
Move utils.cpp functions into separate class and split it up.
Move class-less functions in utils.cpp into a new Utils class and make the old
functions static. This prevents clashes with system C functions. Rename some
functions to avoid macro problems (check() is a macro on OS X). Split out the
RockboxInfo class into a separate file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25441 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallfile.cpp')
| -rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallfile.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp index 2e70610..7649f50 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp @@ -45,16 +45,16 @@ void BootloaderInstallFile::installStage2(void) QCoreApplication::processEvents(); // if an old bootloader is present (Gigabeat) move it out of the way. - QString fwfile(resolvePathCase(m_blfile)); + QString fwfile(Utils::resolvePathCase(m_blfile)); if(!fwfile.isEmpty()) { - QString moved = resolvePathCase(m_blfile) + ".ORIG"; + QString moved = Utils::resolvePathCase(m_blfile) + ".ORIG"; qDebug() << "[BootloaderInstallFile] renaming" << fwfile << "to" << moved; QFile::rename(fwfile, moved); } // if no old file found resolve path without basename QFileInfo fi(m_blfile); - QString absPath = resolvePathCase(fi.absolutePath()); + QString absPath = Utils::resolvePathCase(fi.absolutePath()); // if it's not possible to locate the base path try to create it if(absPath.isEmpty()) { @@ -67,10 +67,10 @@ void BootloaderInstallFile::installStage2(void) QString basePath = pathElements.join("/"); // check for base and bail out if not found. Otherwise create folder. - absPath = resolvePathCase(basePath); + absPath = Utils::resolvePathCase(basePath); QDir d(absPath); d.mkpath(lastElement); - absPath = resolvePathCase(fi.absolutePath()); + absPath = Utils::resolvePathCase(fi.absolutePath()); if(absPath.isEmpty()) { emit logItem(tr("Error accessing output folder"), LOGERROR); @@ -98,13 +98,13 @@ bool BootloaderInstallFile::uninstall(void) qDebug() << "[BootloaderInstallFile] Uninstalling bootloader"; emit logItem(tr("Removing Rockbox bootloader"), LOGINFO); // check if a .ORIG file is present, and allow moving it back. - QString origbl = resolvePathCase(m_blfile + ".ORIG"); + QString origbl = Utils::resolvePathCase(m_blfile + ".ORIG"); if(origbl.isEmpty()) { emit logItem(tr("No original firmware file found."), LOGERROR); emit done(true); return false; } - QString fwfile = resolvePathCase(m_blfile); + QString fwfile = Utils::resolvePathCase(m_blfile); if(!QFile::remove(fwfile)) { emit logItem(tr("Can't remove Rockbox bootloader file."), LOGERROR); emit done(true); @@ -128,10 +128,10 @@ bool BootloaderInstallFile::uninstall(void) BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void) { qDebug() << "[BootloaderInstallFile] checking installed bootloader"; - if(!resolvePathCase(m_blfile).isEmpty() - && !resolvePathCase(m_blfile + ".ORIG").isEmpty()) + if(!Utils::resolvePathCase(m_blfile).isEmpty() + && !Utils::resolvePathCase(m_blfile + ".ORIG").isEmpty()) return BootloaderRockbox; - else if(!resolvePathCase(m_blfile).isEmpty()) + else if(!Utils::resolvePathCase(m_blfile).isEmpty()) return BootloaderOther; else return BootloaderUnknown; |