[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:25:28 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=c45744c
The following commit has been merged in the master branch:
commit c45744cdd5b6e5650d40911b4d336669d1b619df
Author: Jeremy Whiting <jpwhiting at kde.org>
Date: Mon Aug 31 15:53:50 2015 -0600
Reenable tts-filter and make it use QtSpeech instead of dying KSpeech api.
Also made it build by adding the #include "tts-filter.moc", I guess it's been disabled for a little while.
REVIEW:125008
---
CMakeLists.txt | 4 ++++
filters/CMakeLists.txt | 11 +++--------
filters/texttospeech/CMakeLists.txt | 3 +--
filters/texttospeech/tts-filter.cpp | 20 ++++++++------------
4 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e88f6fa..08af615 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,10 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package (KF5 REQUIRED COMPONENTS Archive Sonnet WidgetsAddons Service Emoticons KIO KCMUtils NotifyConfig Notifications I18n WebKit WindowSystem XmlGui ItemViews TextWidgets IconThemes)
find_package (Qt5 REQUIRED COMPONENTS WebKitWidgets)
+find_package(Qt5 ${QT_REQUIRED_VERSION} OPTIONAL_COMPONENTS TextToSpeech)
+if (NOT Qt5TextToSpeech_FOUND)
+ message(STATUS "Qt5TextToSpeech not found, speech features will be disabled")
+endif()
find_package (KTp REQUIRED)
find_package (KF5People)
diff --git a/filters/CMakeLists.txt b/filters/CMakeLists.txt
index 52b3a79..8118b13 100644
--- a/filters/CMakeLists.txt
+++ b/filters/CMakeLists.txt
@@ -9,11 +9,6 @@ add_subdirectory(highlight)
add_subdirectory(urlexpansion)
add_subdirectory(otr)
-# TODO: is that a framework now?
-# IF (EXISTS "${KDE4_DBUS_INTERFACES_DIR}/org.kde.KSpeech.xml")
-# set (HAS_KTTS TRUE)
-# add_subdirectory(texttospeech)
-# ENDIF ()
-# macro_log_feature(HAS_KTTS "KTTSD" "KDE Text to Speech Deamon" "" FALSE "" "Needed for optional tts message plugin")
-
-
+if (Qt5TextToSpeech_FOUND)
+ add_subdirectory(texttospeech)
+endif()
\ No newline at end of file
diff --git a/filters/texttospeech/CMakeLists.txt b/filters/texttospeech/CMakeLists.txt
index f3aaff8..d47bee4 100644
--- a/filters/texttospeech/CMakeLists.txt
+++ b/filters/texttospeech/CMakeLists.txt
@@ -1,11 +1,10 @@
-qt5_add_dbus_interfaces(ktptextui_message_filter_tts_SRCS ${KDE4_DBUS_INTERFACES_DIR}/org.kde.KSpeech.xml)
-
add_library (ktptextui_message_filter_tts MODULE tts-filter.cpp)
target_link_libraries (ktptextui_message_filter_tts
KF5::CoreAddons
KF5::I18n
KTp::CommonInternals
+ Qt5::TextToSpeech
)
# Install:
diff --git a/filters/texttospeech/tts-filter.cpp b/filters/texttospeech/tts-filter.cpp
index bb9c7a5..59c364e 100644
--- a/filters/texttospeech/tts-filter.cpp
+++ b/filters/texttospeech/tts-filter.cpp
@@ -18,32 +18,26 @@
#include "tts-filter.h"
-
#include <KPluginFactory>
#include <KLocalizedString>
-#include <kspeech.h>
-#include <kspeechinterface.h>
-
+#include <QTextToSpeech>
class TTSFilter::Private {
public:
- org::kde::KSpeech *kspeech;
+ QTextToSpeech *speech;
};
-static const KCatalogLoader loader(QLatin1String("ktp-filters"));
-
TTSFilter::TTSFilter(QObject *parent, const QVariantList &)
: KTp::AbstractMessageFilter(parent),
d(new Private)
{
- d->kspeech = new org::kde::KSpeech(QLatin1String("org.kde.kttsd"), QLatin1String("/KSpeech"), QDBusConnection::sessionBus());
- d->kspeech->setApplicationName(i18n("KDE Instant Messaging"));
+ d->speech = new QTextToSpeech();
}
TTSFilter::~TTSFilter()
{
- delete d->kspeech;
+ delete d->speech;
delete d;
}
@@ -59,11 +53,13 @@ void TTSFilter::filterMessage(KTp::Message &message, const KTp::MessageContext &
}
if (message.type() == Tp::ChannelTextMessageTypeNormal) {
- d->kspeech->say(i18nc("Text to Speech - text message %1 is name, %2 is message", "%1 says %2", message.mainMessagePart(), message.senderAlias()), KSpeech::soHtml);
+ d->speech->say(i18nc("Text to Speech - text message %1 is name, %2 is message", "%1 says %2", message.mainMessagePart(), message.senderAlias()));
}
else if (message.type() == Tp::ChannelTextMessageTypeAction) {
- d->kspeech->say(i18nc("Text to Speech - text message %1 is name, %2 is message", "%1 %2", message.mainMessagePart(), message.senderAlias()), KSpeech::soHtml);
+ d->speech->say(i18nc("Text to Speech - text message %1 is name, %2 is message", "%1 %2", message.mainMessagePart(), message.senderAlias()));
}
}
K_PLUGIN_FACTORY(MessageFilterFactory, registerPlugin<TTSFilter>();)
+
+#include "tts-filter.moc"
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list