aboutsummaryrefslogtreecommitdiff
blob: ce4f45c3760191348636dd310aff8f96b9bf7825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
From 53a299c513c447afc57c7f520ac35aea2dffc277 Mon Sep 17 00:00:00 2001
From: Laurent Montel <montel@kde.org>
Date: Fri, 25 Feb 2022 07:29:19 +0100
Subject: [PATCH] Make build without texttospeech support

---
 src/commandoptions.cpp       | 7 +++++++
 src/messagedisplayhelper.cpp | 5 +++++
 src/prefdlg.cpp              | 5 +++++
 src/soundpicker.cpp          | 5 +++++
 4 files changed, 22 insertions(+)

diff --git a/src/commandoptions.cpp b/src/commandoptions.cpp
index a564fbb3..a6bbded1 100644
--- a/src/commandoptions.cpp
+++ b/src/commandoptions.cpp
@@ -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));
diff --git a/src/messagedisplayhelper.cpp b/src/messagedisplayhelper.cpp
index 0f6b9680..6e80e8ca 100644
--- a/src/messagedisplayhelper.cpp
+++ b/src/messagedisplayhelper.cpp
@@ -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
 }
 
 /******************************************************************************
diff --git a/src/prefdlg.cpp b/src/prefdlg.cpp
index ea32116e..d3cf48ae 100644
--- a/src/prefdlg.cpp
+++ b/src/prefdlg.cpp
@@ -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);
diff --git a/src/soundpicker.cpp b/src/soundpicker.cpp
index 426baf96..f85071ea 100644
--- a/src/soundpicker.cpp
+++ b/src/soundpicker.cpp
@@ -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)
     {
-- 
GitLab