forked from len0rd/rockbox
rbutil: Fix various issues found by clazy.
Change-Id: I91ca2baed34f0f3b561602f95f66bbd4e17e74ab
This commit is contained in:
parent
0768705545
commit
01e245417e
9 changed files with 15 additions and 19 deletions
|
@ -190,7 +190,7 @@ QString System::osVersionString(void)
|
|||
if(ret != -1) {
|
||||
result = QString("CPU: %1, %2 processor(s)").arg(u.machine).arg(cores);
|
||||
result += QString("<br/>System: %2<br/>Release: %3<br/>Version: %4")
|
||||
.arg(u.sysname).arg(u.release).arg(u.version);
|
||||
.arg(u.sysname, u.release, u.version);
|
||||
}
|
||||
else {
|
||||
result = QString("(Error when retrieving system information)");
|
||||
|
|
|
@ -254,7 +254,8 @@ bool TalkFileCreator::copyTalkFiles(QString* errString)
|
|||
<< "to" << m_talkList[i].target;
|
||||
if(!QFile::copy(m_talkList[i].talkfilename, m_talkList[i].target))
|
||||
{
|
||||
*errString = tr("Copying of %1 to %2 failed").arg(m_talkList[i].talkfilename).arg(m_talkList[i].target);
|
||||
*errString = tr("Copying of %1 to %2 failed")
|
||||
.arg(m_talkList[i].talkfilename, m_talkList[i].target);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -161,13 +161,13 @@ TalkGenerator::Status TalkGenerator::voiceList(QList<TalkEntry>* list,int wavtri
|
|||
if(status == Warning)
|
||||
{
|
||||
warnings = true;
|
||||
emit logItem(tr("Voicing of %1 failed: %2").arg(list->at(i).toSpeak).arg(error),
|
||||
LOGWARNING);
|
||||
emit logItem(tr("Voicing of %1 failed: %2")
|
||||
.arg(list->at(i).toSpeak, error), LOGWARNING);
|
||||
}
|
||||
else if (status == FatalError)
|
||||
{
|
||||
emit logItem(tr("Voicing of %1 failed: %2").arg(list->at(i).toSpeak).arg(error),
|
||||
LOGERROR);
|
||||
emit logItem(tr("Voicing of %1 failed: %2")
|
||||
.arg(list->at(i).toSpeak, error), LOGERROR);
|
||||
return eERROR;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -193,7 +193,7 @@ TTSStatus TTSFestival::voice(QString text, QString wavfile, QString* errStr)
|
|||
QString path = RbSettings::subValue("festival-client",
|
||||
RbSettings::TtsPath).toString();
|
||||
QString cmd = QString("%1 --server localhost --otype riff --ttw --withlisp"
|
||||
" --output \"%2\" --prolog \"%3\" - ").arg(path).arg(wavfile).arg(prologPath);
|
||||
" --output \"%2\" --prolog \"%3\" - ").arg(path, wavfile, prologPath);
|
||||
LOG_INFO() << "Client cmd:" << cmd;
|
||||
|
||||
QProcess clientProcess;
|
||||
|
|
|
@ -197,7 +197,7 @@ QStringList TTSSapi::getVoiceList(QString language)
|
|||
voicescript->closeWriteChannel();
|
||||
voicescript->waitForReadyRead();
|
||||
|
||||
QString dataRaw = voicescript->readAllStandardError().data();
|
||||
const QString dataRaw = voicescript->readAllStandardError().constData();
|
||||
if(dataRaw.startsWith("Error")) {
|
||||
LOG_INFO() << "Error:" << dataRaw;
|
||||
}
|
||||
|
|
|
@ -1057,7 +1057,7 @@ qint64 Utils::recursiveFolderSize(QString path)
|
|||
size += item.size();
|
||||
}
|
||||
QList<QString> folders = QDir(path).entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
for (auto folder: folders) {
|
||||
for (auto const& folder: folders) {
|
||||
size += recursiveFolderSize(path + "/" + folder);
|
||||
}
|
||||
return size;
|
||||
|
|
|
@ -277,7 +277,6 @@ void SelectiveInstallWidget::installBootloader(void)
|
|||
if(ui.bootloaderCheckbox->isChecked()) {
|
||||
LOG_INFO() << "installing bootloader";
|
||||
|
||||
QString platform = RbSettings::value(RbSettings::Platform).toString();
|
||||
QString backupDestination = "";
|
||||
|
||||
// create installer
|
||||
|
@ -509,7 +508,6 @@ void SelectiveInstallWidget::installVoicefile(void)
|
|||
RockboxInfo installInfo(m_mountpoint);
|
||||
QString voiceurl;
|
||||
QString logversion;
|
||||
QString relversion = installInfo.release();
|
||||
if(m_buildtype != PlayerBuildInfo::TypeRelease) {
|
||||
// release is empty for non-release versions (i.e. daily / current)
|
||||
logversion = installInfo.release();
|
||||
|
@ -549,7 +547,6 @@ void SelectiveInstallWidget::installManual(void)
|
|||
RockboxInfo installInfo(m_mountpoint);
|
||||
QString manualurl;
|
||||
QString logversion;
|
||||
QString relversion = installInfo.release();
|
||||
if(m_buildtype != PlayerBuildInfo::TypeRelease) {
|
||||
// release is empty for non-release versions (i.e. daily / current)
|
||||
logversion = installInfo.release();
|
||||
|
@ -638,7 +635,7 @@ void SelectiveInstallWidget::installPluginData(void)
|
|||
for(size_t i = 0; i < sizeof(PluginDataFiles) / sizeof(PluginDataFiles[0]); i++)
|
||||
{
|
||||
// check if installed Rockbox has this plugin.
|
||||
if(QFileInfo(m_mountpoint + "/.rockbox/rocks/" + PluginDataFiles[i].rockfile).exists()) {
|
||||
if(QFileInfo::exists(m_mountpoint + "/.rockbox/rocks/" + PluginDataFiles[i].rockfile)) {
|
||||
dataName.append(PluginDataFiles[i].name);
|
||||
// game URLs do not depend on the actual build type, but we need
|
||||
// to pass it (simplifies the API, and will allow to make them
|
||||
|
|
|
@ -281,8 +281,7 @@ void RbUtilQt::about()
|
|||
licenses[":/docs/LICENSE.BZIP2"] = "<a id='bzip2'>bzip2 License</a>";
|
||||
licenses[":/docs/LICENSE.BSPATCH"] = "<a id='bspatch'>bspatch License</a>";
|
||||
|
||||
for (int i = 0; i < licenses.size(); i++) {
|
||||
QString key = licenses.keys().at(i);
|
||||
for (auto const& key : licenses.keys()) {
|
||||
QFile license(key);
|
||||
license.open(QIODevice::ReadOnly);
|
||||
QTextStream s(&license);
|
||||
|
@ -461,8 +460,6 @@ void RbUtilQt::uninstallBootloader(void)
|
|||
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
|
||||
logger->show();
|
||||
|
||||
QString platform = RbSettings::value(RbSettings::Platform).toString();
|
||||
|
||||
// create installer
|
||||
BootloaderInstallBase *bl
|
||||
= BootloaderInstallHelper::createBootloaderInstaller(this,
|
||||
|
|
|
@ -148,7 +148,8 @@ class TestHttpGet : public QObject
|
|||
QString tempdir;
|
||||
for(int i = 0; i < 100000; i++) {
|
||||
tempdir = QDir::tempPath() + QString("/qttest-temp-%1").arg(i);
|
||||
if(!QFileInfo(tempdir).exists()) break;
|
||||
if(!QFileInfo::exists(tempdir))
|
||||
break;
|
||||
}
|
||||
QDir().mkpath(tempdir);
|
||||
return QDir(tempdir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue