mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
rbutil: Fix some more issues found by clazy.
Change-Id: I0a1a849ecea4b4666b08ccb050eb17918e90a258
This commit is contained in:
parent
7dffbd84af
commit
f53f1fbafa
10 changed files with 23 additions and 40 deletions
|
@ -80,7 +80,6 @@ class HttpGet : public QObject
|
|||
signals:
|
||||
void done(bool);
|
||||
void dataReadProgress(int, int);
|
||||
void requestFinished(int, bool);
|
||||
void headerFinished(void);
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -36,10 +36,6 @@ class MsPackUtil : public ArchiveUtil
|
|||
virtual bool extractArchive(const QString& dest, QString file = "");
|
||||
virtual QStringList files(void);
|
||||
|
||||
signals:
|
||||
void logProgress(int, int);
|
||||
void logItem(QString, int);
|
||||
|
||||
private:
|
||||
QString errorStringMsPack(int error) const;
|
||||
struct mscab_decompressor* m_cabd;
|
||||
|
|
|
@ -1053,11 +1053,11 @@ qint64 Utils::recursiveFolderSize(QString path)
|
|||
{
|
||||
qint64 size = 0;
|
||||
QList<QFileInfo> items = QDir(path).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
|
||||
for (auto item: items) {
|
||||
for (const auto &item: qAsConst(items)) {
|
||||
size += item.size();
|
||||
}
|
||||
QList<QString> folders = QDir(path).entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
for (auto const& folder: folders) {
|
||||
for (auto const& folder: qAsConst(folders)) {
|
||||
size += recursiveFolderSize(path + "/" + folder);
|
||||
}
|
||||
return size;
|
||||
|
|
|
@ -40,10 +40,6 @@ class ZipUtil : public ArchiveUtil
|
|||
qint64 totalUncompressedSize(unsigned int clustersize = 0);
|
||||
virtual QStringList files(void);
|
||||
|
||||
signals:
|
||||
void logProgress(int, int);
|
||||
void logItem(QString, int);
|
||||
|
||||
private:
|
||||
QList<QuaZipFileInfo> contentProperties();
|
||||
QuaZip* m_zip;
|
||||
|
|
|
@ -600,7 +600,8 @@ void SelectiveInstallWidget::installThemes(void)
|
|||
if(m_themesinstaller == nullptr)
|
||||
m_themesinstaller = new ThemesInstallWindow(this);
|
||||
|
||||
connect(m_themesinstaller, SIGNAL(done(bool)), this, SLOT(continueInstall(bool)));
|
||||
connect(m_themesinstaller, &ThemesInstallWindow::done,
|
||||
this, &SelectiveInstallWidget::continueInstall);
|
||||
m_themesinstaller->setLogger(m_logger);
|
||||
m_themesinstaller->setModal(true);
|
||||
m_themesinstaller->install();
|
||||
|
|
|
@ -31,23 +31,23 @@ class ProgressLoggerGui :public QObject
|
|||
public:
|
||||
ProgressLoggerGui(QWidget * parent);
|
||||
|
||||
virtual void setProgressValue(int value);
|
||||
virtual void setProgressMax(int max);
|
||||
virtual int getProgressMax();
|
||||
virtual void setProgressVisible(bool);
|
||||
void setProgressValue(int value);
|
||||
void setProgressMax(int max);
|
||||
int getProgressMax();
|
||||
void setProgressVisible(bool);
|
||||
|
||||
signals:
|
||||
void aborted();
|
||||
void closed();
|
||||
|
||||
public slots:
|
||||
virtual void addItem(const QString &text, int flag); //! add a string to the list
|
||||
virtual void setProgress(int, int); //! set progress bar
|
||||
void addItem(const QString &text, int flag); //! add a string to the list
|
||||
void setProgress(int, int); //! set progress bar
|
||||
|
||||
virtual void close();
|
||||
virtual void show();
|
||||
virtual void setRunning();
|
||||
virtual void setFinished();
|
||||
void close();
|
||||
void show();
|
||||
void setRunning();
|
||||
void setFinished();
|
||||
|
||||
void saveErrorLog();
|
||||
private:
|
||||
|
|
|
@ -279,11 +279,11 @@ void RbUtilQt::about()
|
|||
licenses[":/docs/LICENSE.BZIP2"] = "<a id='bzip2'>bzip2 License</a>";
|
||||
licenses[":/docs/LICENSE.BSPATCH"] = "<a id='bspatch'>bspatch License</a>";
|
||||
|
||||
for (auto const& key : licenses.keys()) {
|
||||
QFile license(key);
|
||||
for (auto it = licenses.keyBegin(); it != licenses.keyEnd(); ++it) {
|
||||
QFile license(*it);
|
||||
license.open(QIODevice::ReadOnly);
|
||||
QTextStream s(&license);
|
||||
about.browserLicenses->insertHtml("<hr/><h2>" + licenses[key] + "</h2><br/>\n");
|
||||
about.browserLicenses->insertHtml("<hr/><h2>" + licenses[*it] + "</h2><br/>\n");
|
||||
about.browserLicenses->insertHtml("<pre>" + s.readAll() + "</pre>");
|
||||
license.close();
|
||||
}
|
||||
|
@ -675,7 +675,7 @@ void RbUtilQt::downloadUpdateDone(bool error)
|
|||
tr("<b>New Rockbox Utility version available.</b><br><br>"
|
||||
"You are currently using version %1. "
|
||||
"Get version %2 at <a href='%3'>%3</a>")
|
||||
.arg(VERSION).arg(Utils::trimVersionString(foundVersion)).arg(url));
|
||||
.arg(VERSION, Utils::trimVersionString(foundVersion), url));
|
||||
ui.statusbar->showMessage(tr("New version of Rockbox Utility available."));
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -72,8 +72,7 @@ QString Sysinfo::getInfo(Sysinfo::InfoType type)
|
|||
.arg(QDir::toNativeSeparators(drives.at(i)))
|
||||
.arg((double)Utils::filesystemFree(drives.at(i)) / (1<<30), 0, 'f', 2)
|
||||
.arg((double)Utils::filesystemTotal(drives.at(i)) / (1<<30), 0, 'f', 2)
|
||||
.arg(Utils::filesystemName(drives.at(i)))
|
||||
.arg(Utils::filesystemType(drives.at(i)));
|
||||
.arg(Utils::filesystemName(drives.at(i)), Utils::filesystemType(drives.at(i)));
|
||||
}
|
||||
info += "</table>";
|
||||
info += "<hr/>";
|
||||
|
|
|
@ -44,7 +44,7 @@ ThemesInstallWindow::ThemesInstallWindow(QWidget *parent) : QDialog(parent)
|
|||
ui.themeDescription->setLayoutDirection(Qt::LeftToRight);
|
||||
|
||||
connect(ui.buttonCancel, &QAbstractButton::clicked, this, &QWidget::close);
|
||||
connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
|
||||
connect(ui.buttonOk, &QAbstractButton::clicked, this, &ThemesInstallWindow::accept);
|
||||
connect(ui.listThemes, &QListWidget::currentItemChanged,
|
||||
this, &ThemesInstallWindow::updateDetails);
|
||||
connect(ui.listThemes, &QListWidget::itemSelectionChanged, this, &ThemesInstallWindow::updateSize);
|
||||
|
@ -94,19 +94,12 @@ void ThemesInstallWindow::downloadInfo()
|
|||
LOG_INFO() << "Info URL:" << url;
|
||||
getter->setFile(&themesInfo);
|
||||
|
||||
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||
connect(getter, &HttpGet::done, this, &ThemesInstallWindow::downloadDone);
|
||||
connect(logger, &ProgressLoggerGui::aborted, getter, &HttpGet::abort);
|
||||
getter->getFile(url);
|
||||
}
|
||||
|
||||
|
||||
void ThemesInstallWindow::downloadDone(int id, bool error)
|
||||
{
|
||||
downloadDone(error);
|
||||
LOG_INFO() << "Download" << id << "done, error:" << error;
|
||||
}
|
||||
|
||||
|
||||
void ThemesInstallWindow::downloadDone(bool error)
|
||||
{
|
||||
LOG_INFO() << "Download done, error:" << error;
|
||||
|
@ -129,7 +122,7 @@ void ThemesInstallWindow::downloadDone(bool error)
|
|||
.arg(getter->errorString()), LOGERROR);
|
||||
getter->abort();
|
||||
logger->setFinished();
|
||||
disconnect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||
disconnect(getter, &HttpGet::done, this, &ThemesInstallWindow::downloadDone);
|
||||
connect(logger, &ProgressLoggerGui::closed, this, &QWidget::close);
|
||||
return;
|
||||
}
|
||||
|
@ -376,7 +369,7 @@ void ThemesInstallWindow::install()
|
|||
}
|
||||
connect(installer, &ZipInstaller::logItem, logger, &ProgressLoggerGui::addItem);
|
||||
connect(installer, &ZipInstaller::logProgress, logger, &ProgressLoggerGui::setProgress);
|
||||
connect(installer, SIGNAL(done(bool)), this, SIGNAL(done(bool)));
|
||||
connect(installer, &ZipInstaller::done, this, &ThemesInstallWindow::done);
|
||||
connect(logger, &ProgressLoggerGui::aborted, installer, &ZipInstaller::abort);
|
||||
installer->install();
|
||||
}
|
||||
|
|
|
@ -66,7 +66,6 @@ class ThemesInstallWindow : public QDialog
|
|||
|
||||
private slots:
|
||||
void downloadDone(bool);
|
||||
void downloadDone(int, bool);
|
||||
void updateImage(bool);
|
||||
void abort(void);
|
||||
void updateDetails(QListWidgetItem* cur, QListWidgetItem* prev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue