1
0
Fork 0
forked from len0rd/rockbox

rbutil: Fix some minor issues found by clazy.

Change-Id: I0e63df09caf959dcb325c6ad2297c4348388a831
This commit is contained in:
Dominik Riebeling 2020-08-21 20:45:59 +02:00
parent f1f72ff8df
commit 201e9bcde8
6 changed files with 7 additions and 8 deletions

View file

@ -48,7 +48,7 @@ void BootloaderInstallMi4::installStage2(void)
QFile oldbl(fwfile); QFile oldbl(fwfile);
QString moved = QFileInfo(Utils::resolvePathCase(m_blfile)).absolutePath() QString moved = QFileInfo(Utils::resolvePathCase(m_blfile)).absolutePath()
+ "/OF.mi4"; + "/OF.mi4";
if(!QFileInfo(moved).exists()) { if(!QFileInfo::exists(moved)) {
LOG_INFO() << "renaming" << fwfile << "to" << moved; LOG_INFO() << "renaming" << fwfile << "to" << moved;
oldbl.rename(moved); oldbl.rename(moved);
} }

View file

@ -145,7 +145,7 @@ bool TalkFileCreator::createTalkList(QDir startDir)
if(!dir.dirName().isEmpty() && m_talkFolders) if(!dir.dirName().isEmpty() && m_talkFolders)
{ {
// check if we should ignore it // check if we should ignore it
if(m_generateOnlyNew && QFileInfo(dir.path() + "/_dirname.talk").exists()) if(m_generateOnlyNew && QFileInfo::exists(dir.path() + "/_dirname.talk"))
{ {
continue; continue;
} }
@ -186,7 +186,7 @@ bool TalkFileCreator::createTalkList(QDir startDir)
continue; continue;
// check if we should ignore it // check if we should ignore it
if(m_generateOnlyNew && QFileInfo(fileInf.path() + "/" + fileInf.fileName() + ".talk").exists()) if(m_generateOnlyNew && QFileInfo::exists(fileInf.path() + "/" + fileInf.fileName() + ".talk"))
{ {
continue; continue;
} }

View file

@ -119,7 +119,7 @@ TTSStatus TTSExes::voice(QString text, QString wavfile, QString *errStr)
bool TTSExes::configOk() bool TTSExes::configOk()
{ {
loadSettings(); loadSettings();
if (QFileInfo(m_TTSexec).exists()) if (QFileInfo::exists(m_TTSexec))
return true; return true;
else else
return false; return false;

View file

@ -42,7 +42,7 @@ void TTSSapi::generateSettings()
// language // language
QMap<QString, QStringList> languages = SystemInfo::languages(); QMap<QString, QStringList> languages = SystemInfo::languages();
QStringList langs; QStringList langs;
for(int i = 0; i < languages.values().size(); ++i) { for(int i = 0; i < languages.size(); ++i) {
langs.append(languages.values().at(i).at(0)); langs.append(languages.values().at(i).at(0));
} }
EncTtsSetting* setting = new EncTtsSetting(this, EncTtsSetting* setting = new EncTtsSetting(this,

View file

@ -121,6 +121,6 @@ QStringList Uninstaller::getAllSections()
bool Uninstaller::uninstallPossible() bool Uninstaller::uninstallPossible()
{ {
return QFileInfo(m_mountpoint +"/.rockbox/rbutil.log").exists(); return QFileInfo::exists(m_mountpoint +"/.rockbox/rbutil.log");
} }

View file

@ -69,7 +69,7 @@ bool Utils::recursiveRmdir( const QString &dirName )
// make list of entries in directory // make list of entries in directory
QStringList list = dir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot); QStringList list = dir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot);
QFileInfo fileInfo; QFileInfo fileInfo;
QString curItem, lstAt; QString curItem;
for(int i = 0; i < list.size(); i++){ // loop through all items of list for(int i = 0; i < list.size(); i++){ // loop through all items of list
QString name = list.at(i); QString name = list.at(i);
curItem = dirN + "/" + name; curItem = dirN + "/" + name;
@ -281,7 +281,6 @@ qulonglong Utils::filesystemSize(QString path, enum Utils::Size type)
//! \brief searches for a Executable in the Environement Path //! \brief searches for a Executable in the Environement Path
QString Utils::findExecutable(QString name) QString Utils::findExecutable(QString name)
{ {
QString exepath;
//try autodetect tts //try autodetect tts
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD) #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
#if QT_VERSION >= 0x050e00 #if QT_VERSION >= 0x050e00