mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kutils: return boolean from KSpeech::removeAllJobs() and KSpeech::removeJob()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d659ad0241
commit
c7514f9157
2 changed files with 16 additions and 6 deletions
|
@ -334,33 +334,43 @@ int KSpeech::say(const QString &text)
|
|||
#endif // HAVE_SPEECHD
|
||||
}
|
||||
|
||||
void KSpeech::removeAllJobs()
|
||||
bool KSpeech::removeAllJobs()
|
||||
{
|
||||
#if defined(HAVE_SPEECHD)
|
||||
if (Q_UNLIKELY(!d->m_speechd)) {
|
||||
kDebug() << "Null speech-dispatcher pointer";
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const int speechdresult = spd_stop(d->m_speechd);
|
||||
if (Q_UNLIKELY(speechdresult < 0)) {
|
||||
kWarning() << "Speech-dispatcher stop failed";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
kWarning() << "KSpeech is a stub";
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void KSpeech::removeJob(int jobNum)
|
||||
bool KSpeech::removeJob(int jobNum)
|
||||
{
|
||||
#if defined(HAVE_SPEECHD)
|
||||
if (Q_UNLIKELY(!d->m_speechd)) {
|
||||
kWarning() << "Null speech-dispatcher pointer";
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const int speechdresult = spd_stop_uid(d->m_speechd, jobNum);
|
||||
if (Q_UNLIKELY(speechdresult < 0)) {
|
||||
kWarning() << "Speech-dispatcher stop uid failed";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
kWarning() << "KSpeech is a stub";
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ public:
|
|||
public Q_SLOTS:
|
||||
int say(const QString &text);
|
||||
|
||||
void removeAllJobs();
|
||||
void removeJob(int jobNum);
|
||||
bool removeAllJobs();
|
||||
bool removeJob(int jobNum);
|
||||
|
||||
Q_SIGNALS:
|
||||
void jobStateChanged(int jobNum, int state);
|
||||
|
|
Loading…
Add table
Reference in a new issue