Commit 53a299c5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make build without texttospeech support

parent 976f825b
Pipeline #142039 passed with stage
in 1 minute and 42 seconds
......@@ -14,7 +14,10 @@
#include "kalarm_debug.h"
#include <KAlarmCal/Identities>
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/TextToSpeech>
#endif
#include <KLocalizedString>
#include <QCommandLineParser>
......@@ -570,7 +573,11 @@ void CommandOptions::process()
{
if (mParser->isSet(*mOptions.at(BEEP)))
setErrorIncompatible(BEEP, SPEAK);
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
else if (!KPIMTextEdit::TextToSpeech::self()->isReady())
#else
else
#endif
setError(xi18nc("@info:shell", "<icode>%1</icode> requires KAlarm to be compiled with QTextToSpeech support", optionName(SPEAK)));
}
const bool onceOnly = mParser->isSet(*mOptions.at(REMINDER_ONCE));
......
......@@ -21,7 +21,10 @@
#include "lib/synchtimer.h"
#include "kalarm_debug.h"
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/TextToSpeech>
#endif
#include <KLocalizedString>
#include <KConfig>
......@@ -831,6 +834,7 @@ void MessageDisplayHelper::playAudio()
*/
void MessageDisplayHelper::slotSpeak()
{
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
KPIMTextEdit::TextToSpeech* tts = KPIMTextEdit::TextToSpeech::self();
if (!tts->isReady())
{
......@@ -840,6 +844,7 @@ void MessageDisplayHelper::slotSpeak()
}
tts->say(mMessage);
#endif
}
/******************************************************************************
......
......@@ -48,7 +48,10 @@
#include <KHolidays/HolidayRegion>
using namespace KHolidays;
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/TextToSpeech>
#endif
#include <KLocalizedString>
#include <KShell>
......@@ -1355,8 +1358,10 @@ EditPrefTab::EditPrefTab(StackedScrollGroup* scrollGroup)
mSound->addItem(SoundPicker::i18n_combo_None()); // index 0
mSound->addItem(SoundPicker::i18n_combo_Beep()); // index 1
mSound->addItem(SoundPicker::i18n_combo_File()); // index 2
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
if (KPIMTextEdit::TextToSpeech::self()->isReady())
mSound->addItem(SoundPicker::i18n_combo_Speak()); // index 3
#endif
mSound->setMinimumSize(mSound->sizeHint());
mSound->setWhatsThis(defsetting.subs(SoundPicker::i18n_label_Sound()).toString());
hlayout->addWidget(mSound);
......
......@@ -16,7 +16,10 @@
#include "lib/pushbutton.h"
#include "kalarm_debug.h"
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/TextToSpeech>
#endif
#include <KLocalizedString>
#include <phonon/backendcapabilities.h>
......@@ -130,7 +133,9 @@ void SoundPicker::showFile(bool show)
*/
void SoundPicker::showSpeak(bool show)
{
#if KPIMTEXTEDIT_TEXT_TO_SPEECH
if (!KPIMTextEdit::TextToSpeech::self()->isReady())
#endif
show = false; // speech capability is not installed or configured
if (show != mSpeakShowing)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment