summaryrefslogtreecommitdiff
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-12-16 17:34:28 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2021-01-02 21:31:20 +0100
commitf9d23bfd41d36ac1c39b31ff7d45ebe1597ed4f4 (patch)
treec429dde83656eecb7be256180328356fc8cc9a39 /rbutil
parent022bbad76281ee0f1cf72d6912eaa32c34273ef9 (diff)
rbutil: Modernize connect() to new pointer-to-member syntax.
Change-Id: If737fe5a8f4ab9f83560511839fdc4ad8b187786
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/base/talkfile.cpp22
-rw-r--r--rbutil/rbutilqt/base/ttsfestival.cpp9
-rw-r--r--rbutil/rbutilqt/base/ttssapi.cpp4
-rw-r--r--rbutil/rbutilqt/base/voicefile.cpp14
-rw-r--r--rbutil/rbutilqt/base/zipinstaller.cpp12
5 files changed, 31 insertions, 30 deletions
diff --git a/rbutil/rbutilqt/base/talkfile.cpp b/rbutil/rbutilqt/base/talkfile.cpp
index 1b1dd934ed..cef53c852b 100644
--- a/rbutil/rbutilqt/base/talkfile.cpp
+++ b/rbutil/rbutilqt/base/talkfile.cpp
@@ -49,19 +49,17 @@ bool TalkFileCreator::createTalkFiles()
QCoreApplication::processEvents();
// generate entries
+ TalkGenerator generator(this);
+ // no string corrections yet: do not set language for TalkGenerator.
+ connect(&generator, &TalkGenerator::done, this, &TalkFileCreator::done);
+ connect(&generator, &TalkGenerator::logItem, this, &TalkFileCreator::logItem);
+ connect(&generator, &TalkGenerator::logProgress, this, &TalkFileCreator::logProgress);
+ connect(this, &TalkFileCreator::aborted, &generator, &TalkGenerator::abort);
+
+ if(generator.process(&m_talkList) == TalkGenerator::eERROR)
{
- TalkGenerator generator(this);
- // no string corrections yet: do not set language for TalkGenerator.
- connect(&generator,SIGNAL(done(bool)),this,SIGNAL(done(bool)));
- connect(&generator,SIGNAL(logItem(QString,int)),this,SIGNAL(logItem(QString,int)));
- connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int)));
- connect(this,SIGNAL(aborted()),&generator,SLOT(abort()));
-
- if(generator.process(&m_talkList) == TalkGenerator::eERROR)
- {
- doAbort();
- return false;
- }
+ doAbort();
+ return false;
}
// Copying talk files
diff --git a/rbutil/rbutilqt/base/ttsfestival.cpp b/rbutil/rbutilqt/base/ttsfestival.cpp
index b50ad516c7..d0ca400909 100644
--- a/rbutil/rbutilqt/base/ttsfestival.cpp
+++ b/rbutil/rbutilqt/base/ttsfestival.cpp
@@ -58,14 +58,17 @@ void TTSFestival::generateSettings()
EncTtsSetting::eSTRINGLIST, tr("Voice:"),
RbSettings::subValue("festival", RbSettings::TtsVoice),
getVoiceList(), EncTtsSetting::eREFRESHBTN);
- connect(setting,SIGNAL(refresh()),this,SLOT(updateVoiceList()));
- connect(setting,SIGNAL(dataChanged()),this,SLOT(clearVoiceDescription()));
+ connect(setting, &EncTtsSetting::refresh,
+ this, &TTSFestival::updateVoiceList);
+ connect(setting, &EncTtsSetting::dataChanged,
+ this, &TTSFestival::clearVoiceDescription);
insertSetting(eVOICE,setting);
//voice description
setting = new EncTtsSetting(this,EncTtsSetting::eREADONLYSTRING,
tr("Voice description:"),"",EncTtsSetting::eREFRESHBTN);
- connect(setting,SIGNAL(refresh()),this,SLOT(updateVoiceDescription()));
+ connect(setting, &EncTtsSetting::refresh,
+ this, &TTSFestival::updateVoiceDescription);
insertSetting(eVOICEDESC,setting);
}
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp
index ab972445f3..1b326b301e 100644
--- a/rbutil/rbutilqt/base/ttssapi.cpp
+++ b/rbutil/rbutilqt/base/ttssapi.cpp
@@ -46,7 +46,7 @@ void TTSSapi::generateSettings()
EncTtsSetting::eSTRINGLIST, tr("Language:"),
RbSettings::subValue(m_TTSType, RbSettings::TtsLanguage),
langmap.keys());
- connect(setting,SIGNAL(dataChanged()),this,SLOT(updateVoiceList()));
+ connect(setting, &EncTtsSetting::dataChanged, this, &TTSSapi::updateVoiceList);
insertSetting(eLANGUAGE,setting);
// voice
setting = new EncTtsSetting(this,
@@ -55,7 +55,7 @@ void TTSSapi::generateSettings()
getVoiceList(RbSettings::subValue(m_TTSType,
RbSettings::TtsLanguage).toString()),
EncTtsSetting::eREFRESHBTN);
- connect(setting,SIGNAL(refresh()),this,SLOT(updateVoiceList()));
+ connect(setting, &EncTtsSetting::refresh, this, &TTSSapi::updateVoiceList);
insertSetting(eVOICE,setting);
//speed
int speed = RbSettings::subValue(m_TTSType, RbSettings::TtsSpeed).toInt();
diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp
index 98ab96b8ab..eabf7a721a 100644
--- a/rbutil/rbutilqt/base/voicefile.cpp
+++ b/rbutil/rbutilqt/base/voicefile.cpp
@@ -166,9 +166,9 @@ bool VoiceFileCreator::createVoiceFile()
getter = new HttpGet(this);
getter->setFile(downloadFile);
- connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
- connect(getter, SIGNAL(dataReadProgress(int, int)), this, SIGNAL(logProgress(int, int)));
- connect(this, SIGNAL(aborted()), getter, SLOT(abort()));
+ connect(getter, &HttpGet::done, this, &VoiceFileCreator::downloadDone);
+ connect(getter, &HttpGet::dataReadProgress, this, &VoiceFileCreator::logProgress);
+ connect(this, &VoiceFileCreator::aborted, getter, &HttpGet::abort);
emit logItem(tr("Downloading voice info..."),LOGINFO);
getter->getFile(genlangUrl);
return true;
@@ -284,10 +284,10 @@ void VoiceFileCreator::create(void)
// set language for string correction. If not set no correction will be made.
if(useCorrection)
generator.setLang(m_lang);
- connect(&generator,SIGNAL(done(bool)),this,SIGNAL(done(bool)));
- connect(&generator,SIGNAL(logItem(QString,int)),this,SIGNAL(logItem(QString,int)));
- connect(&generator,SIGNAL(logProgress(int,int)),this,SIGNAL(logProgress(int,int)));
- connect(this,SIGNAL(aborted()),&generator,SLOT(abort()));
+ connect(&generator, &TalkGenerator::done, this, &VoiceFileCreator::done);
+ connect(&generator, &TalkGenerator::logItem, this, &VoiceFileCreator::logItem);
+ connect(&generator, &TalkGenerator::logProgress, this, &VoiceFileCreator::logProgress);
+ connect(this, &VoiceFileCreator::aborted, &generator, &TalkGenerator::abort);
if(generator.process(&m_talkList, m_wavtrimThreshold) == TalkGenerator::eERROR)
{
diff --git a/rbutil/rbutilqt/base/zipinstaller.cpp b/rbutil/rbutilqt/base/zipinstaller.cpp
index 3376169911..8de6c53b16 100644
--- a/rbutil/rbutilqt/base/zipinstaller.cpp
+++ b/rbutil/rbutilqt/base/zipinstaller.cpp
@@ -34,7 +34,7 @@ void ZipInstaller::install()
LOG_INFO() << "initializing installation";
m_runner = 0;
- connect(this, SIGNAL(cont()), this, SLOT(installContinue()));
+ connect(this, &ZipInstaller::cont, this, &ZipInstaller::installContinue);
m_url = m_urllist.at(m_runner);
m_logsection = m_loglist.at(m_runner);
m_logver = m_verlist.at(m_runner);
@@ -94,9 +94,9 @@ void ZipInstaller::installStart()
}
m_getter->setFile(m_downloadFile);
- connect(m_getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
- connect(m_getter, SIGNAL(dataReadProgress(int, int)), this, SIGNAL(logProgress(int, int)));
- connect(this, SIGNAL(internalAborted()), m_getter, SLOT(abort()));
+ connect(m_getter, &HttpGet::done, this, &ZipInstaller::downloadDone);
+ connect(m_getter, &HttpGet::dataReadProgress, this, &ZipInstaller::logProgress);
+ connect(this, &ZipInstaller::internalAborted, m_getter, &HttpGet::abort);
m_getter->getFile(QUrl(m_url));
}
@@ -133,8 +133,8 @@ void ZipInstaller::downloadDone(bool error)
QCoreApplication::processEvents();
ZipUtil zip(this);
- connect(&zip, SIGNAL(logProgress(int, int)), this, SIGNAL(logProgress(int, int)));
- connect(&zip, SIGNAL(logItem(QString, int)), this, SIGNAL(logItem(QString, int)));
+ connect(&zip, &ZipUtil::logProgress, this, &ZipInstaller::logProgress);
+ connect(&zip, &ZipUtil::logItem, this, &ZipInstaller::logItem);
zip.open(m_file, QuaZip::mdUnzip);
// check for free space. Make sure after installation will still be
// some room for operating (also includes calculation mistakes due to