1
0
Fork 0
forked from len0rd/rockbox

rbutil: Modernize connect() to new pointer-to-member syntax.

Change-Id: I6bb86e34438eef10813f0d19e910599156a876e6
This commit is contained in:
Dominik Riebeling 2020-11-21 10:21:31 +01:00
parent f29b81d521
commit efacce58eb
13 changed files with 26 additions and 26 deletions

View file

@ -57,7 +57,7 @@ bool BootloaderInstallAms::install(void)
// download firmware from server // download firmware from server
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallAms::installStage2);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
return true; return true;

View file

@ -48,11 +48,11 @@ void BootloaderInstallBase::downloadBlStart(QUrl source)
{ {
m_http.setFile(&m_tempfile); m_http.setFile(&m_tempfile);
m_http.setCache(true); m_http.setCache(true);
connect(&m_http, SIGNAL(done(bool)), this, SLOT(downloadBlFinish(bool))); connect(&m_http, &HttpGet::done, this, &BootloaderInstallBase::downloadBlFinish);
// connect the http read signal to our logProgess *signal* // connect the http read signal to our logProgess *signal*
// to immediately emit it without any helper function. // to immediately emit it without any helper function.
connect(&m_http, SIGNAL(dataReadProgress(int, int)), connect(&m_http, &HttpGet::dataReadProgress,
this, SIGNAL(logProgress(int, int))); this, &BootloaderInstallBase::logProgress);
m_http.getFile(source); m_http.getFile(source);
} }

View file

@ -88,7 +88,7 @@ bool BootloaderInstallBSPatch::install(void)
LOG_INFO() << "downloading bootloader"; LOG_INFO() << "downloading bootloader";
// download bootloader from server // download bootloader from server
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallBSPatch::installStage2);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
return true; return true;
} }
@ -109,7 +109,7 @@ void BootloaderInstallBSPatch::installStage2(void)
m_thread->setOutputFile(m_patchedFile.fileName()); m_thread->setOutputFile(m_patchedFile.fileName());
m_tempfile.close(); m_tempfile.close();
m_patchedFile.close(); m_patchedFile.close();
connect(m_thread, SIGNAL(finished()), this, SLOT(installStage3())); connect(m_thread, &QThread::finished, this, &BootloaderInstallBSPatch::installStage3);
m_thread->start(); m_thread->start();
} }

View file

@ -49,7 +49,7 @@ bool BootloaderInstallChinaChip::install()
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallChinaChip::installStage2);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
return true; return true;

View file

@ -34,7 +34,7 @@ bool BootloaderInstallFile::install(void)
emit logItem(tr("Downloading bootloader"), LOGINFO); emit logItem(tr("Downloading bootloader"), LOGINFO);
LOG_INFO() << "installing bootloader"; LOG_INFO() << "installing bootloader";
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallFile::installStage2);
return true; return true;
} }

View file

@ -122,7 +122,7 @@ bool BootloaderInstallHex::install(void)
// download firmware from server // download firmware from server
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallHex::installStage2);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
return true; return true;

View file

@ -98,7 +98,7 @@ bool BootloaderInstallImx::install(void)
LOG_INFO() << "downloading bootloader"; LOG_INFO() << "downloading bootloader";
// download bootloader from server // download bootloader from server
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallImx::installStage2);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
return true; return true;
} }
@ -120,7 +120,7 @@ void BootloaderInstallImx::installStage2(void)
m_thread->setOutputFile(m_patchedFile.fileName()); m_thread->setOutputFile(m_patchedFile.fileName());
m_tempfile.close(); m_tempfile.close();
m_patchedFile.close(); m_patchedFile.close();
connect(m_thread, SIGNAL(finished()), this, SLOT(installStage3())); connect(m_thread, &QThread::finished, this, &BootloaderInstallImx::installStage3);
connect(m_thread, SIGNAL(terminated()), this, SLOT(installStage3())); connect(m_thread, SIGNAL(terminated()), this, SLOT(installStage3()));
m_thread->start(); m_thread->start();
} }

View file

@ -80,7 +80,7 @@ bool BootloaderInstallIpod::install(void)
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallIpod::installStage2);
return true; return true;
} }

View file

@ -34,7 +34,7 @@ bool BootloaderInstallMi4::install(void)
emit logItem(tr("Downloading bootloader"), LOGINFO); emit logItem(tr("Downloading bootloader"), LOGINFO);
LOG_INFO() << "installing bootloader"; LOG_INFO() << "installing bootloader";
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallMi4::installStage2);
return true; return true;
} }

View file

@ -52,7 +52,7 @@ bool BootloaderInstallMpio::install(void)
// download firmware from server // download firmware from server
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallMpio::installStage2);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
return true; return true;

View file

@ -66,7 +66,7 @@ bool BootloaderInstallS5l::installStage1(void)
if (doInstall) { if (doInstall) {
// download firmware from server // download firmware from server
emit logItem(tr("Downloading bootloader file..."), LOGINFO); emit logItem(tr("Downloading bootloader file..."), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStageMkdfu())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallS5l::installStageMkdfu);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
} }
else { else {
@ -87,8 +87,8 @@ void BootloaderInstallS5l::installStageMkdfu(void)
setProgress(0); setProgress(0);
aborted = false; aborted = false;
connect(this, SIGNAL(installAborted()), this, SLOT(abortInstall())); connect(this, &BootloaderInstallBase::installAborted, this, &BootloaderInstallS5l::abortInstall);
connect(this, SIGNAL(done(bool)), this, SLOT(installDone(bool))); connect(this, &BootloaderInstallBase::done, this, &BootloaderInstallS5l::installDone);
if (doInstall) { if (doInstall) {
dfu_type = DFU_INST; dfu_type = DFU_INST;
@ -142,7 +142,7 @@ void BootloaderInstallS5l::installStageWaitForEject(void)
LOGWARNING); LOGWARNING);
actionShown = true; actionShown = true;
} }
QTimer::singleShot(250, this, SLOT(installStageWaitForEject())); QTimer::singleShot(250, this, &BootloaderInstallS5l::installStageWaitForEject);
return; return;
} }
emit logItem(tr("Device successfully ejected."), LOGINFO); emit logItem(tr("Device successfully ejected."), LOGINFO);
@ -169,7 +169,7 @@ void BootloaderInstallS5l::installStageWaitForProcs(void)
" Quit iTunes application."), LOGWARNING); " Quit iTunes application."), LOGWARNING);
actionShown = true; actionShown = true;
} }
QTimer::singleShot(250, this, SLOT(installStageWaitForProcs())); QTimer::singleShot(250, this, &BootloaderInstallS5l::installStageWaitForProcs);
return; return;
} }
if (actionShown) { if (actionShown) {
@ -206,7 +206,7 @@ void BootloaderInstallS5l::installStageWaitForSpindown(void)
return; /* aborted */ return; /* aborted */
if (progressTimer.elapsed() < progressTimeout) { if (progressTimer.elapsed() < progressTimeout) {
QTimer::singleShot(250, this, SLOT(installStageWaitForSpindown())); QTimer::singleShot(250, this, &BootloaderInstallS5l::installStageWaitForSpindown);
return; return;
} }
@ -232,7 +232,7 @@ void BootloaderInstallS5l::installStageWaitForDfu(void)
scanTimer.start(); scanTimer.start();
} }
if (!scanSuccess) { if (!scanSuccess) {
QTimer::singleShot(250, this, SLOT(installStageWaitForDfu())); QTimer::singleShot(250, this, &BootloaderInstallS5l::installStageWaitForDfu);
return; return;
} }
emit logItem(tr("DFU mode detected."), LOGINFO); emit logItem(tr("DFU mode detected."), LOGINFO);
@ -256,7 +256,7 @@ void BootloaderInstallS5l::installStageSendDfu(void)
return; /* aborted */ return; /* aborted */
if (progressTimer.elapsed() < progressTimeout) { if (progressTimer.elapsed() < progressTimeout) {
QTimer::singleShot(250, this, SLOT(installStageSendDfu())); QTimer::singleShot(250, this, &BootloaderInstallS5l::installStageSendDfu);
return; return;
} }
@ -324,7 +324,7 @@ void BootloaderInstallS5l::installStageWaitForRemount(void)
LOGWARNING); LOGWARNING);
actionShown = true; actionShown = true;
} }
QTimer::singleShot(250, this, SLOT(installStageWaitForRemount())); QTimer::singleShot(250, this, &BootloaderInstallS5l::installStageWaitForRemount);
return; return;
} }
emit logItem(tr("Device remounted."), LOGINFO); emit logItem(tr("Device remounted."), LOGINFO);
@ -350,7 +350,7 @@ void BootloaderInstallS5l::abortInstall(void)
{ {
LOG_INFO() << "abortInstall"; LOG_INFO() << "abortInstall";
aborted = true; aborted = true;
disconnect(this, SIGNAL(installAborted()), this, SLOT(abortInstall())); disconnect(this, &BootloaderInstallBase::installAborted, this, &BootloaderInstallS5l::abortInstall);
} }

View file

@ -79,7 +79,7 @@ bool BootloaderInstallSansa::install(void)
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallSansa::installStage2);
return true; return true;
} }

View file

@ -49,7 +49,7 @@ bool BootloaderInstallTcc::install(void)
// Download firmware from server // Download firmware from server
emit logItem(tr("Downloading bootloader file"), LOGINFO); emit logItem(tr("Downloading bootloader file"), LOGINFO);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); connect(this, &BootloaderInstallBase::downloadDone, this, &BootloaderInstallTcc::installStage2);
downloadBlStart(m_blurl); downloadBlStart(m_blurl);
return true; return true;