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

Change-Id: If737fe5a8f4ab9f83560511839fdc4ad8b187786
This commit is contained in:
Dominik Riebeling 2020-12-16 17:34:28 +01:00
parent 022bbad762
commit f9d23bfd41
5 changed files with 31 additions and 30 deletions

View File

@ -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,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()));
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)
{
doAbort();
return false;
}
if(generator.process(&m_talkList) == TalkGenerator::eERROR)
{
doAbort();
return false;
}
// Copying talk files

View File

@ -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);
}

View File

@ -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();

View File

@ -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)
{

View File

@ -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