From 1ad4faa33403dc24ddc6f907f2b56bbe968d77f2 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 26 Dec 2021 19:50:19 +0100 Subject: [PATCH] rbutil: Modernize connect() calls. Auto fixed by clazy. Change-Id: Iea16d892fd81c151f0081f7476acc5eda62afc25 --- utils/rbutilqt/configure.cpp | 2 +- utils/rbutilqt/createvoicewindow.cpp | 6 ++--- utils/rbutilqt/gui/backupdialog.cpp | 5 ++-- utils/rbutilqt/gui/changelog.cpp | 2 +- utils/rbutilqt/gui/selectiveinstallwidget.cpp | 24 +++++++++---------- utils/rbutilqt/installtalkwindow.cpp | 6 ++--- utils/rbutilqt/rbutilqt.cpp | 4 ++-- utils/rbutilqt/themesinstallwindow.cpp | 14 +++++------ utils/rbutilqt/uninstallwindow.cpp | 4 ++-- 9 files changed, 33 insertions(+), 34 deletions(-) diff --git a/utils/rbutilqt/configure.cpp b/utils/rbutilqt/configure.cpp index 6f64a007a9..169499800e 100644 --- a/utils/rbutilqt/configure.cpp +++ b/utils/rbutilqt/configure.cpp @@ -94,7 +94,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent) this->setModal(true); - connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(ui.buttonOk, &QAbstractButton::clicked, this, &Config::accept); connect(ui.buttonCancel, &QAbstractButton::clicked, this, &Config::abort); connect(ui.radioNoProxy, &QAbstractButton::toggled, this, &Config::setNoProxy); connect(ui.radioSystemProxy, &QAbstractButton::toggled, this, &Config::setSystemProxy); diff --git a/utils/rbutilqt/createvoicewindow.cpp b/utils/rbutilqt/createvoicewindow.cpp index 36131cb537..703f1e774c 100644 --- a/utils/rbutilqt/createvoicewindow.cpp +++ b/utils/rbutilqt/createvoicewindow.cpp @@ -58,10 +58,10 @@ void CreateVoiceWindow::accept() voicecreator->setWavtrimThreshold(ui.wavtrimthreshold->value()); //start creating - connect(voicecreator, SIGNAL(done(bool)), logger, SLOT(setFinished())); - connect(voicecreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); + connect(voicecreator, &VoiceFileCreator::done, logger, &ProgressLoggerGui::setFinished); + connect(voicecreator, &VoiceFileCreator::logItem, logger, &ProgressLoggerGui::addItem); connect(voicecreator, &VoiceFileCreator::logProgress, logger, &ProgressLoggerGui::setProgress); - connect(logger,SIGNAL(aborted()),voicecreator,SLOT(abort())); + connect(logger,&ProgressLoggerGui::aborted,voicecreator,&VoiceFileCreator::abort); voicecreator->createVoiceFile(); } diff --git a/utils/rbutilqt/gui/backupdialog.cpp b/utils/rbutilqt/gui/backupdialog.cpp index 63e628f7cf..e48d0babae 100644 --- a/utils/rbutilqt/gui/backupdialog.cpp +++ b/utils/rbutilqt/gui/backupdialog.cpp @@ -60,7 +60,6 @@ BackupDialog::BackupDialog(QWidget* parent) : QDialog(parent) m_thread = new BackupSizeThread(); connect(m_thread, &QThread::finished, this, &BackupDialog::updateSizeInfo); - connect(m_thread, SIGNAL(terminated()), this, SLOT(updateSizeInfo())); connect(ui.buttonCancel, &QAbstractButton::clicked, this, &QWidget::close); connect(ui.buttonCancel, &QAbstractButton::clicked, m_thread, &QThread::quit); @@ -135,8 +134,8 @@ void BackupDialog::backup(void) // create backup ZipUtil zip(this); - connect(&zip, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int))); - connect(&zip, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); + connect(&zip, &ZipUtil::logProgress, m_logger, &ProgressLoggerGui::setProgress); + connect(&zip, &ZipUtil::logItem, m_logger, &ProgressLoggerGui::addItem); zip.open(m_backupName, QuaZip::mdCreate); QString mp = m_mountpoint + "/.rockbox"; diff --git a/utils/rbutilqt/gui/changelog.cpp b/utils/rbutilqt/gui/changelog.cpp index 6495c0ebd9..f256f3805c 100644 --- a/utils/rbutilqt/gui/changelog.cpp +++ b/utils/rbutilqt/gui/changelog.cpp @@ -28,7 +28,7 @@ Changelog::Changelog(QWidget *parent) : QDialog(parent) ui.browserChangelog->setHtml(parseChangelogFile(":/docs/changelog.txt")); ui.browserChangelog->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor); ui.checkBoxShowAlways->setChecked(RbSettings::value(RbSettings::ShowChangelog).toBool()); - connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(ui.buttonOk, &QAbstractButton::clicked, this, &Changelog::accept); } diff --git a/utils/rbutilqt/gui/selectiveinstallwidget.cpp b/utils/rbutilqt/gui/selectiveinstallwidget.cpp index 341a4072cc..a558015ded 100644 --- a/utils/rbutilqt/gui/selectiveinstallwidget.cpp +++ b/utils/rbutilqt/gui/selectiveinstallwidget.cpp @@ -292,9 +292,9 @@ void SelectiveInstallWidget::installBootloader(void) // the bootloader install class does NOT use any GUI stuff. // All messages are passed via signals. - connect(bl, SIGNAL(done(bool)), m_logger, SLOT(setFinished())); + connect(bl, &BootloaderInstallBase::done, m_logger, &ProgressLoggerGui::setFinished); connect(bl, &BootloaderInstallBase::done, this, &SelectiveInstallWidget::continueInstall); - connect(bl, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); + connect(bl, &BootloaderInstallBase::logItem, m_logger, &ProgressLoggerGui::addItem); connect(bl, &BootloaderInstallBase::logProgress, m_logger, &ProgressLoggerGui::setProgress); // pass Abort button click signal to current installer connect(m_logger, SIGNAL(aborted()), bl, SLOT(progressAborted())); @@ -447,9 +447,9 @@ void SelectiveInstallWidget::installRockbox(void) connect(m_zipinstaller, &ZipInstaller::done, this, &SelectiveInstallWidget::continueInstall); - connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); + connect(m_zipinstaller, &ZipInstaller::logItem, m_logger, &ProgressLoggerGui::addItem); connect(m_zipinstaller, &ZipInstaller::logProgress, m_logger, &ProgressLoggerGui::setProgress); - connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort())); + connect(m_logger, &ProgressLoggerGui::aborted, m_zipinstaller, &ZipInstaller::abort); m_zipinstaller->install(); } @@ -488,9 +488,9 @@ void SelectiveInstallWidget::installFonts(void) m_zipinstaller->setCache(true); connect(m_zipinstaller, &ZipInstaller::done, this, &SelectiveInstallWidget::continueInstall); - connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); + connect(m_zipinstaller, &ZipInstaller::logItem, m_logger, &ProgressLoggerGui::addItem); connect(m_zipinstaller, &ZipInstaller::logProgress, m_logger, &ProgressLoggerGui::setProgress); - connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort())); + connect(m_logger, &ProgressLoggerGui::aborted, m_zipinstaller, &ZipInstaller::abort); m_zipinstaller->install(); } else { @@ -527,9 +527,9 @@ void SelectiveInstallWidget::installVoicefile(void) m_zipinstaller->setCache(true); connect(m_zipinstaller, &ZipInstaller::done, this, &SelectiveInstallWidget::continueInstall); - connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); + connect(m_zipinstaller, &ZipInstaller::logItem, m_logger, &ProgressLoggerGui::addItem); connect(m_zipinstaller, &ZipInstaller::logProgress, m_logger, &ProgressLoggerGui::setProgress); - connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort())); + connect(m_logger, &ProgressLoggerGui::aborted, m_zipinstaller, &ZipInstaller::abort); m_zipinstaller->install(); } else { @@ -572,9 +572,9 @@ void SelectiveInstallWidget::installManual(void) m_zipinstaller->setUnzip(mantype == "html"); connect(m_zipinstaller, &ZipInstaller::done, this, &SelectiveInstallWidget::continueInstall); - connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); + connect(m_zipinstaller, &ZipInstaller::logItem, m_logger, &ProgressLoggerGui::addItem); connect(m_zipinstaller, &ZipInstaller::logProgress, m_logger, &ProgressLoggerGui::setProgress); - connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort())); + connect(m_logger, &ProgressLoggerGui::aborted, m_zipinstaller, &ZipInstaller::abort); m_zipinstaller->install(); } else { @@ -667,9 +667,9 @@ void SelectiveInstallWidget::installPluginData(void) if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) m_zipinstaller->setCache(true); connect(m_zipinstaller, &ZipInstaller::done, this, &SelectiveInstallWidget::continueInstall); - connect(m_zipinstaller, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); + connect(m_zipinstaller, &ZipInstaller::logItem, m_logger, &ProgressLoggerGui::addItem); connect(m_zipinstaller, &ZipInstaller::logProgress, m_logger, &ProgressLoggerGui::setProgress); - connect(m_logger, SIGNAL(aborted()), m_zipinstaller, SLOT(abort())); + connect(m_logger, &ProgressLoggerGui::aborted, m_zipinstaller, &ZipInstaller::abort); m_zipinstaller->install(); } else { diff --git a/utils/rbutilqt/installtalkwindow.cpp b/utils/rbutilqt/installtalkwindow.cpp index bf374decb5..a3570196f5 100644 --- a/utils/rbutilqt/installtalkwindow.cpp +++ b/utils/rbutilqt/installtalkwindow.cpp @@ -116,10 +116,10 @@ void InstallTalkWindow::accept() talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",", QString::SkipEmptyParts)); #endif - connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished())); - connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); + connect(talkcreator, &TalkFileCreator::done, logger, &ProgressLoggerGui::setFinished); + connect(talkcreator, &TalkFileCreator::logItem, logger, &ProgressLoggerGui::addItem); connect(talkcreator, &TalkFileCreator::logProgress, logger, &ProgressLoggerGui::setProgress); - connect(logger,SIGNAL(aborted()),talkcreator,SLOT(abort())); + connect(logger,&ProgressLoggerGui::aborted,talkcreator,&TalkFileCreator::abort); for(int i = 0; i < foldersToTalk.size(); i++) { LOG_INFO() << "creating talk files for folder" diff --git a/utils/rbutilqt/rbutilqt.cpp b/utils/rbutilqt/rbutilqt.cpp index 7c11f44806..a9878646da 100644 --- a/utils/rbutilqt/rbutilqt.cpp +++ b/utils/rbutilqt/rbutilqt.cpp @@ -497,9 +497,9 @@ void RbUtilQt::uninstallBootloader(void) return; } - connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); + connect(bl, &BootloaderInstallBase::logItem, logger, &ProgressLoggerGui::addItem); connect(bl, &BootloaderInstallBase::logProgress, logger, &ProgressLoggerGui::setProgress); - connect(bl, SIGNAL(done(bool)), logger, SLOT(setFinished())); + connect(bl, &BootloaderInstallBase::done, logger, &ProgressLoggerGui::setFinished); // pass Abort button click signal to current installer connect(logger, SIGNAL(aborted()), bl, SLOT(progressAborted())); diff --git a/utils/rbutilqt/themesinstallwindow.cpp b/utils/rbutilqt/themesinstallwindow.cpp index 358bd7f1a1..129df8a980 100644 --- a/utils/rbutilqt/themesinstallwindow.cpp +++ b/utils/rbutilqt/themesinstallwindow.cpp @@ -95,7 +95,7 @@ void ThemesInstallWindow::downloadInfo() getter->setFile(&themesInfo); connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); - connect(logger, SIGNAL(aborted()), getter, SLOT(abort())); + connect(logger, &ProgressLoggerGui::aborted, getter, &HttpGet::abort); getter->getFile(url); } @@ -111,8 +111,8 @@ void ThemesInstallWindow::downloadDone(bool error) { LOG_INFO() << "Download done, error:" << error; - disconnect(logger, SIGNAL(aborted()), getter, SLOT(abort())); - disconnect(logger, SIGNAL(aborted()), this, SLOT(close())); + disconnect(logger, &ProgressLoggerGui::aborted, getter, &HttpGet::abort); + disconnect(logger, &ProgressLoggerGui::aborted, this, &QWidget::close); themesInfo.open(); QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this); @@ -299,7 +299,7 @@ void ThemesInstallWindow::show() logger->show(); logger->addItem(tr("getting themes information ..."), LOGINFO); - connect(logger, SIGNAL(aborted()), this, SLOT(close())); + connect(logger, &ProgressLoggerGui::aborted, this, &QWidget::close); downloadInfo(); } @@ -372,12 +372,12 @@ void ThemesInstallWindow::install() if(!windowSelectOnly) { connect(logger, &ProgressLoggerGui::closed, this, &QWidget::close); - connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished())); + connect(installer, &ZipInstaller::done, logger, &ProgressLoggerGui::setFinished); } - connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); + connect(installer, &ZipInstaller::logItem, logger, &ProgressLoggerGui::addItem); connect(installer, &ZipInstaller::logProgress, logger, &ProgressLoggerGui::setProgress); connect(installer, SIGNAL(done(bool)), this, SIGNAL(done(bool))); - connect(logger, SIGNAL(aborted()), installer, SLOT(abort())); + connect(logger, &ProgressLoggerGui::aborted, installer, &ZipInstaller::abort); installer->install(); } diff --git a/utils/rbutilqt/uninstallwindow.cpp b/utils/rbutilqt/uninstallwindow.cpp index bbce88ffc2..c0c9de4c89 100644 --- a/utils/rbutilqt/uninstallwindow.cpp +++ b/utils/rbutilqt/uninstallwindow.cpp @@ -31,9 +31,9 @@ UninstallWindow::UninstallWindow(QWidget *parent) : QDialog(parent) uninstaller = new Uninstaller(this,mountpoint); logger = new ProgressLoggerGui(this); - connect(uninstaller, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); + connect(uninstaller, &Uninstaller::logItem, logger, &ProgressLoggerGui::addItem); connect(uninstaller, &Uninstaller::logProgress, logger, &ProgressLoggerGui::setProgress); - connect(uninstaller, SIGNAL(logFinished(void)), logger, SLOT(setFinished(void))); + connect(uninstaller, &Uninstaller::logFinished, logger, &ProgressLoggerGui::setFinished); connect(logger, &ProgressLoggerGui::closed, this, &QWidget::close); // disable smart uninstall, if not possible