From 9fedc8187f746960ea4608f7bb9e5e9b2667fd39 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Fri, 2 Apr 2010 21:24:19 +0000 Subject: 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 --- rbutil/rbutilqt/base/autodetection.cpp | 1 + rbutil/rbutilqt/base/bootloaderinstallbase.cpp | 4 +- rbutil/rbutilqt/base/bootloaderinstallfile.cpp | 20 ++++---- rbutil/rbutilqt/base/bootloaderinstallmi4.cpp | 14 +++--- rbutil/rbutilqt/base/encoders.cpp | 2 +- rbutil/rbutilqt/base/rockboxinfo.cpp | 67 ++++++++++++++++++++++++++ rbutil/rbutilqt/base/rockboxinfo.h | 49 +++++++++++++++++++ rbutil/rbutilqt/base/ttsexes.cpp | 2 +- rbutil/rbutilqt/base/ttsfestival.cpp | 4 +- rbutil/rbutilqt/base/uninstall.cpp | 2 +- rbutil/rbutilqt/base/utils.cpp | 63 +++++------------------- rbutil/rbutilqt/base/utils.h | 28 +++-------- rbutil/rbutilqt/base/voicefile.cpp | 1 + rbutil/rbutilqt/base/zipinstaller.cpp | 2 +- rbutil/rbutilqt/configure.cpp | 4 +- rbutil/rbutilqt/installwindow.cpp | 3 +- rbutil/rbutilqt/rbutilqt.cpp | 3 +- rbutil/rbutilqt/rbutilqt.pri | 2 + rbutil/rbutilqt/sysinfo.cpp | 2 +- rbutil/rbutilqt/themesinstallwindow.cpp | 2 +- 20 files changed, 170 insertions(+), 105 deletions(-) create mode 100644 rbutil/rbutilqt/base/rockboxinfo.cpp create mode 100644 rbutil/rbutilqt/base/rockboxinfo.h diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp index 98d24c3369..f233f0c3fd 100644 --- a/rbutil/rbutilqt/base/autodetection.cpp +++ b/rbutil/rbutilqt/base/autodetection.cpp @@ -54,6 +54,7 @@ #include "system.h" #include "utils.h" +#include "rockboxinfo.h" Autodetection::Autodetection(QObject* parent): QObject(parent) { diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp index f6fb33dcd4..6a2db76392 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp @@ -114,7 +114,7 @@ bool BootloaderInstallBase::backup(QString to) } QString tofile = to + "/" + QFileInfo(m_blfile).fileName(); qDebug() << "[BootloaderInstallBase] trying to backup" << m_blfile << "to" << tofile; - if(!QFile::copy(resolvePathCase(m_blfile), tofile)) { + if(!QFile::copy(Utils::resolvePathCase(m_blfile), tofile)) { emit logItem(tr("Creating backup copy failed."), LOGERROR); return false; } @@ -247,7 +247,7 @@ void BootloaderInstallBase::setBlFile(QStringList sl) { // figue which of the possible bootloader filenames is correct. for(int a = 0; a < sl.size(); a++) { - if(!resolvePathCase(sl.at(a)).isEmpty()) { + if(!Utils::resolvePathCase(sl.at(a)).isEmpty()) { m_blfile = sl.at(a); } } diff --git a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp index 2e7061036d..7649f50e2a 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; diff --git a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp index 936ad175c3..859ed2ca04 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallmi4.cpp @@ -44,9 +44,9 @@ void BootloaderInstallMi4::installStage2(void) QCoreApplication::processEvents(); // move old bootloader out of the way - QString fwfile(resolvePathCase(m_blfile)); + QString fwfile(Utils::resolvePathCase(m_blfile)); QFile oldbl(fwfile); - QString moved = QFileInfo(resolvePathCase(m_blfile)).absolutePath() + QString moved = QFileInfo(Utils::resolvePathCase(m_blfile)).absolutePath() + "/OF.mi4"; if(!QFileInfo(moved).exists()) { qDebug() << "[BootloaderInstallMi4] renaming" << fwfile << "to" << moved; @@ -83,20 +83,20 @@ bool BootloaderInstallMi4::uninstall(void) // check if OF file present emit logItem(tr("Checking for original firmware file"), LOGINFO); - QString original = QFileInfo(resolvePathCase(m_blfile)).absolutePath() + QString original = QFileInfo(Utils::resolvePathCase(m_blfile)).absolutePath() + "/OF.mi4"; - if(resolvePathCase(original).isEmpty()) { + if(Utils::resolvePathCase(original).isEmpty()) { emit logItem(tr("Error finding original firmware file"), LOGERROR); return false; } // finally remove RB bootloader - QString resolved = resolvePathCase(m_blfile); + QString resolved = Utils::resolvePathCase(m_blfile); QFile blfile(resolved); blfile.remove(); - QFile::rename(resolvePathCase(original), m_blfile); + QFile::rename(Utils::resolvePathCase(original), m_blfile); emit logItem(tr("Rockbox bootloader successful removed"), LOGINFO); logInstall(LogRemove); emit done(false); @@ -114,7 +114,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void) // make sure to resolve case to prevent case issues QString resolved; - resolved = resolvePathCase(m_blfile); + resolved = Utils::resolvePathCase(m_blfile); if(resolved.isEmpty()) { qDebug() << "[BootloaderInstallMi4] installed: BootloaderNone"; return BootloaderNone; diff --git a/rbutil/rbutilqt/base/encoders.cpp b/rbutil/rbutilqt/base/encoders.cpp index 7f4163a34f..3b9e1432ed 100644 --- a/rbutil/rbutilqt/base/encoders.cpp +++ b/rbutil/rbutilqt/base/encoders.cpp @@ -89,7 +89,7 @@ EncExes::EncExes(QString name,QObject *parent) : EncBase(parent) void EncExes::generateSettings() { QString exepath =RbSettings::subValue(m_name,RbSettings::EncoderPath).toString(); - if(exepath == "") exepath = findExecutable(m_name); + if(exepath == "") exepath = Utils::findExecutable(m_name); insertSetting(eEXEPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING, tr("Path to Encoder:"),exepath,EncTtsSetting::eBROWSEBTN)); diff --git a/rbutil/rbutilqt/base/rockboxinfo.cpp b/rbutil/rbutilqt/base/rockboxinfo.cpp new file mode 100644 index 0000000000..f85c23b669 --- /dev/null +++ b/rbutil/rbutilqt/base/rockboxinfo.cpp @@ -0,0 +1,67 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2007 by Dominik Wenger + * $Id$ + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "rockboxinfo.h" + +#include +#include + +RockboxInfo::RockboxInfo(QString mountpoint) +{ + qDebug() << "[RockboxInfo] trying to find rockbox-info at" << mountpoint; + QFile file(mountpoint + "/.rockbox/rockbox-info.txt"); + m_success = false; + if(!file.exists()) + return; + + if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) + return; + + // read file contents + while (!file.atEnd()) + { + QString line = file.readLine(); + + if(line.contains("Version:")) + { + m_version = line.remove("Version:").trimmed(); + } + else if(line.contains("Target: ")) + { + m_target = line.remove("Target: ").trimmed(); + } + else if(line.contains("Features:")) + { + m_features = line.remove("Features:").trimmed(); + } + else if(line.contains("Target id:")) + { + m_targetid = line.remove("Target id:").trimmed(); + } + else if(line.contains("Memory:")) + { + m_ram = line.remove("Memory:").trimmed().toInt(); + } + } + + file.close(); + m_success = true; + return; +} + diff --git a/rbutil/rbutilqt/base/rockboxinfo.h b/rbutil/rbutilqt/base/rockboxinfo.h new file mode 100644 index 0000000000..4d704f8f72 --- /dev/null +++ b/rbutil/rbutilqt/base/rockboxinfo.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2007 by Dominik Wenger + * $Id$ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + + +#ifndef ROCKBOXINFO_H +#define ROCKBOXINFO_H + +#include + +class RockboxInfo +{ +public: + RockboxInfo(QString mountpoint); + + QString version() {return m_version;} + QString features(){return m_features;} + QString targetID() {return m_targetid;} + QString target() {return m_target;} + int ram() { return m_ram; } + bool success() { return m_success; } +private: + QString m_version; + QString m_features; + QString m_targetid; + QString m_target; + int m_ram; + bool m_success; +}; + +#endif + diff --git a/rbutil/rbutilqt/base/ttsexes.cpp b/rbutil/rbutilqt/base/ttsexes.cpp index 05ed23b41d..bd14e2a9ee 100644 --- a/rbutil/rbutilqt/base/ttsexes.cpp +++ b/rbutil/rbutilqt/base/ttsexes.cpp @@ -34,7 +34,7 @@ TTSExes::TTSExes(QString name,QObject* parent) : TTSBase(parent) void TTSExes::generateSettings() { QString exepath =RbSettings::subValue(m_name,RbSettings::TtsPath).toString(); - if(exepath == "") exepath = findExecutable(m_name); + if(exepath == "") exepath = Utils::findExecutable(m_name); insertSetting(eEXEPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING, tr("Path to TTS engine:"),exepath,EncTtsSetting::eBROWSEBTN)); diff --git a/rbutil/rbutilqt/base/ttsfestival.cpp b/rbutil/rbutilqt/base/ttsfestival.cpp index be67b67bd2..7cad16d3dd 100644 --- a/rbutil/rbutilqt/base/ttsfestival.cpp +++ b/rbutil/rbutilqt/base/ttsfestival.cpp @@ -32,7 +32,7 @@ void TTSFestival::generateSettings() // server path QString exepath = RbSettings::subValue("festival-server", RbSettings::TtsPath).toString(); - if(exepath == "" ) exepath = findExecutable("festival"); + if(exepath == "" ) exepath = Utils::findExecutable("festival"); insertSetting(eSERVERPATH,new EncTtsSetting(this, EncTtsSetting::eSTRING, "Path to Festival server:", exepath,EncTtsSetting::eBROWSEBTN)); @@ -40,7 +40,7 @@ void TTSFestival::generateSettings() // client path QString clientpath = RbSettings::subValue("festival-client", RbSettings::TtsPath).toString(); - if(clientpath == "" ) clientpath = findExecutable("festival_client"); + if(clientpath == "" ) clientpath = Utils::findExecutable("festival_client"); insertSetting(eCLIENTPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING, tr("Path to Festival client:"), clientpath,EncTtsSetting::eBROWSEBTN)); diff --git a/rbutil/rbutilqt/base/uninstall.cpp b/rbutil/rbutilqt/base/uninstall.cpp index 15ada35c5e..2f3b3c767f 100644 --- a/rbutil/rbutilqt/base/uninstall.cpp +++ b/rbutil/rbutilqt/base/uninstall.cpp @@ -32,7 +32,7 @@ void Uninstaller::deleteAll(ProgressloggerInterface* dp) QString rbdir(m_mountpoint + ".rockbox/"); m_dp->addItem(tr("Starting Uninstallation"),LOGINFO); m_dp->setProgressMax(0); - recRmdir(rbdir); + Utils::recursiveRmdir(rbdir); m_dp->setProgressMax(1); m_dp->setProgressValue(1); m_dp->addItem(tr("Finished Uninstallation"),LOGOK); diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp index 623dfebe2f..767b3c1c52 100644 --- a/rbutil/rbutilqt/base/utils.cpp +++ b/rbutil/rbutilqt/base/utils.cpp @@ -18,6 +18,7 @@ ****************************************************************************/ #include "utils.h" +#include "rockboxinfo.h" #include "system.h" #include "rbsettings.h" #include "systeminfo.h" @@ -41,7 +42,7 @@ #endif // recursive function to delete a dir with files -bool recRmdir( const QString &dirName ) +bool Utils::recursiveRmdir( const QString &dirName ) { QString dirN = dirName; QDir dir(dirN); @@ -54,19 +55,21 @@ bool recRmdir( const QString &dirName ) curItem = dirN + "/" + name; fileInfo.setFile(curItem); if(fileInfo.isDir()) // is directory - recRmdir(curItem); // call recRmdir() recursively for deleting subdirectory + recursiveRmdir(curItem); // call recRmdir() recursively for + // deleting subdirectory else // is file - QFile::remove(curItem); // ok, delete file + QFile::remove(curItem); // ok, delete file } dir.cdUp(); - return dir.rmdir(dirN); // delete empty dir and return if (now empty) dir-removing was successfull + return dir.rmdir(dirN); // delete empty dir and return if (now empty) + // dir-removing was successfull } //! @brief resolves the given path, ignoring case. //! @param path absolute path to resolve. //! @return returns exact casing of path, empty string if path not found. -QString resolvePathCase(QString path) +QString Utils::resolvePathCase(QString path) { QStringList elems; QString realpath; @@ -110,7 +113,7 @@ QString resolvePathCase(QString path) //! @brief figure the free disk space on a filesystem //! @param path path on the filesystem to check //! @return size in bytes -qulonglong filesystemFree(QString path) +qulonglong Utils::filesystemFree(QString path) { qlonglong size = 0; #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) @@ -135,7 +138,7 @@ qulonglong filesystemFree(QString path) } //! \brief searches for a Executable in the Environement Path -QString findExecutable(QString name) +QString Utils::findExecutable(QString name) { QString exepath; //try autodetect tts @@ -167,7 +170,7 @@ QString findExecutable(QString name) * @param permission if it should check for permission * @return string with error messages if problems occurred, empty strings if none. */ -QString check(bool permission) +QString Utils::checkEnvironment(bool permission) { QString text = ""; @@ -201,47 +204,3 @@ QString check(bool permission) return text; } - -RockboxInfo::RockboxInfo(QString mountpoint) -{ - qDebug() << "[RockboxInfo] trying to find rockbox-info at" << mountpoint; - QFile file(mountpoint + "/.rockbox/rockbox-info.txt"); - m_success = false; - if(!file.exists()) - return; - - if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) - return; - - // read file contents - while (!file.atEnd()) - { - QString line = file.readLine(); - - if(line.contains("Version:")) - { - m_version = line.remove("Version:").trimmed(); - } - else if(line.contains("Target: ")) - { - m_target = line.remove("Target: ").trimmed(); - } - else if(line.contains("Features:")) - { - m_features = line.remove("Features:").trimmed(); - } - else if(line.contains("Target id:")) - { - m_targetid = line.remove("Target id:").trimmed(); - } - else if(line.contains("Memory:")) - { - m_ram = line.remove("Memory:").trimmed().toInt(); - } - } - - file.close(); - m_success = true; - return; -} - diff --git a/rbutil/rbutilqt/base/utils.h b/rbutil/rbutilqt/base/utils.h index ba1989b3c3..cdc3d3be5b 100644 --- a/rbutil/rbutilqt/base/utils.h +++ b/rbutil/rbutilqt/base/utils.h @@ -26,30 +26,14 @@ #include #include -bool recRmdir( const QString &dirName ); -QString resolvePathCase(QString path); -qulonglong filesystemFree(QString path); -QString findExecutable(QString name); -QString check(bool permission); - -class RockboxInfo +class Utils { public: - RockboxInfo(QString mountpoint); - - QString version() {return m_version;} - QString features(){return m_features;} - QString targetID() {return m_targetid;} - QString target() {return m_target;} - int ram() { return m_ram; } - bool success() { return m_success; } -private: - QString m_version; - QString m_features; - QString m_targetid; - QString m_target; - int m_ram; - bool m_success; + static bool recursiveRmdir(const QString &dirName); + static QString resolvePathCase(QString path); + static qulonglong filesystemFree(QString path); + static QString findExecutable(QString name); + static QString checkEnvironment(bool permission); }; #endif diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp index ccdf6f7f9a..208cd1eeb8 100644 --- a/rbutil/rbutilqt/base/voicefile.cpp +++ b/rbutil/rbutilqt/base/voicefile.cpp @@ -19,6 +19,7 @@ #include "voicefile.h" #include "utils.h" +#include "rockboxinfo.h" #include "rbsettings.h" #include "systeminfo.h" diff --git a/rbutil/rbutilqt/base/zipinstaller.cpp b/rbutil/rbutilqt/base/zipinstaller.cpp index 6a59cdad02..1822d3c9ed 100644 --- a/rbutil/rbutilqt/base/zipinstaller.cpp +++ b/rbutil/rbutilqt/base/zipinstaller.cpp @@ -148,7 +148,7 @@ void ZipInstaller::downloadDone(bool error) // check for free space. Make sure after installation will still be // some room for operating (also includes calculation mistakes due to // cluster sizes on the player). - if(filesystemFree(m_mountpoint) < (uz.totalSize() + 1000000)) { + if(Utils::filesystemFree(m_mountpoint) < (uz.totalSize() + 1000000)) { emit logItem(tr("Not enough disk space! Aborting."), LOGERROR); emit logProgress(1, 1); emit done(true); diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index 3411717398..7ed74f1b9e 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp @@ -756,8 +756,8 @@ void Config::testTts() } tts->stop(); #if defined(Q_OS_LINUX) - QString exe = findExecutable("aplay"); - if(exe == "") exe = findExecutable("play"); + QString exe = Utils::findExecutable("aplay"); + if(exe == "") exe = Utils::findExecutable("play"); if(exe != "") { QProcess::execute(exe+" "+filename); diff --git a/rbutil/rbutilqt/installwindow.cpp b/rbutil/rbutilqt/installwindow.cpp index 9eae0ce09f..7b12303b96 100644 --- a/rbutil/rbutilqt/installwindow.cpp +++ b/rbutil/rbutilqt/installwindow.cpp @@ -25,6 +25,7 @@ #include "serverinfo.h" #include "systeminfo.h" #include "utils.h" +#include "rockboxinfo.h" InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent) { @@ -168,7 +169,7 @@ void InstallWindow::accept() RbSettings::sync(); - QString warning = check(false); + QString warning = Utils::checkEnvironment(false); if(!warning.isEmpty()) { if(QMessageBox::warning(this, tr("Really continue?"), warning, diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 575b381e3b..56d66115c1 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -31,6 +31,7 @@ #include "themesinstallwindow.h" #include "uninstallwindow.h" #include "utils.h" +#include "rockboxinfo.h" #include "rbzip.h" #include "sysinfo.h" #include "system.h" @@ -556,7 +557,7 @@ bool RbUtilQt::installAuto() file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString()); // check installed Version and Target - QString warning = check(false); + QString warning = Utils::checkEnvironment(false); if(!warning.isEmpty()) { if(QMessageBox::warning(this, tr("Really continue?"), warning, diff --git a/rbutil/rbutilqt/rbutilqt.pri b/rbutil/rbutilqt/rbutilqt.pri index c3a16a9b57..53742570df 100644 --- a/rbutil/rbutilqt/rbutilqt.pri +++ b/rbutil/rbutilqt/rbutilqt.pri @@ -67,6 +67,7 @@ SOURCES += \ base/bootloaderinstallchinachip.cpp \ base/bootloaderinstallams.cpp \ base/bootloaderinstalltcc.cpp \ + base/rockboxinfo.cpp \ ../../tools/mkboot.c \ ../../tools/iriver.c \ @@ -132,6 +133,7 @@ HEADERS += \ base/bootloaderinstallchinachip.h \ base/bootloaderinstallams.h \ base/bootloaderinstalltcc.h \ + base/rockboxinfo.h \ ../../tools/mkboot.h \ ../../tools/iriver.h \ diff --git a/rbutil/rbutilqt/sysinfo.cpp b/rbutil/rbutilqt/sysinfo.cpp index 65818df068..a9fa5999b7 100644 --- a/rbutil/rbutilqt/sysinfo.cpp +++ b/rbutil/rbutilqt/sysinfo.cpp @@ -65,7 +65,7 @@ QString Sysinfo::getInfo() for(int i = 0; i < drives.size(); i++) { info += tr("%1, %2 MiB available") .arg(QDir::toNativeSeparators(drives.at(i))) - .arg(filesystemFree(drives.at(i)) / (1024*1024)); + .arg(Utils::filesystemFree(drives.at(i)) / (1024*1024)); if(i + 1 < drives.size()) info += "
"; } diff --git a/rbutil/rbutilqt/themesinstallwindow.cpp b/rbutil/rbutilqt/themesinstallwindow.cpp index 4c75d431fb..0f7ecef065 100644 --- a/rbutil/rbutilqt/themesinstallwindow.cpp +++ b/rbutil/rbutilqt/themesinstallwindow.cpp @@ -50,7 +50,7 @@ ThemesInstallWindow::ThemesInstallWindow(QWidget *parent) : QDialog(parent) ThemesInstallWindow::~ThemesInstallWindow() { if(infocachedir!="") - recRmdir(infocachedir); + Utils::recursiveRmdir(infocachedir); } -- cgit v1.2.3