Hello community, here is the log from the commit of package knotifications for openSUSE:Factory checked in at 2015-03-16 09:32:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/knotifications (Old) and /work/SRC/openSUSE:Factory/.knotifications.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "knotifications" Changes: -------- --- /work/SRC/openSUSE:Factory/knotifications/knotifications.changes 2015-02-16 17:31:55.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.knotifications.new/knotifications.changes 2015-03-16 09:32:08.000000000 +0100 @@ -1,0 +2,10 @@ +Sat Mar 7 16:58:49 UTC 2015 - [email protected] + +- Update to 5.8.0 + * Delay the audio init until actually needed + * Fix notification config not applying instantly + * Fix audio notifications stopping after first file played + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.8.0.php + +------------------------------------------------------------------- Old: ---- knotifications-5.7.0.tar.xz New: ---- knotifications-5.8.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ knotifications.spec ++++++ --- /var/tmp/diff_new_pack.evkZKJ/_old 2015-03-16 09:32:09.000000000 +0100 +++ /var/tmp/diff_new_pack.evkZKJ/_new 2015-03-16 09:32:09.000000000 +0100 @@ -17,13 +17,13 @@ %define lname libKF5Notifications5 -%define _tar_path 5.7 +%define _tar_path 5.8 Name: knotifications Version: %{_tar_path}.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.7.0 +BuildRequires: extra-cmake-modules >= 1.8.0 BuildRequires: fdupes BuildRequires: kcodecs-devel >= %{kf5_version} BuildRequires: kconfig-devel >= %{kf5_version} ++++++ knotifications-5.7.0.tar.xz -> knotifications-5.8.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/CMakeLists.txt new/knotifications-5.8.0/CMakeLists.txt --- old/knotifications-5.7.0/CMakeLists.txt 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/CMakeLists.txt 2015-03-07 15:47:35.000000000 +0100 @@ -3,7 +3,7 @@ project(KNotifications) # ECM setup -find_package(ECM 1.7.0 REQUIRED NO_MODULE) +find_package(ECM 1.8.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(FeatureSummary) @@ -13,8 +13,8 @@ include(ECMPoQmTools) -set(KF5_VERSION "5.7.0") # handled by release scripts -set(KF5_DEP_VERSION "5.7.0") # handled by release scripts +set(KF5_VERSION "5.8.0") # handled by release scripts +set(KF5_DEP_VERSION "5.8.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KNOTIFICATIONS @@ -27,6 +27,13 @@ set(REQUIRED_QT_VERSION "5.2.0") find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus) +find_package(Qt5 ${REQUIRED_QT_VERSION} QUIET OPTIONAL_COMPONENTS TextToSpeech) +if (NOT Qt5TextToSpeech_FOUND) + message(STATUS "Qt5TextToSpeech not found, notifications by tts will not be built") +else() + add_definitions(-DHAVE_SPEECH) +endif() + include(KDEInstallDirs) include(KDEFrameworkCompilerSettings) include(KDECMakeSettings) @@ -71,6 +78,7 @@ ecm_configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KF5NotificationsConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KF5NotificationsConfig.cmake" + PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) @@ -88,4 +96,4 @@ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel ) -feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/KF5NotificationsConfig.cmake.in new/knotifications-5.8.0/KF5NotificationsConfig.cmake.in --- old/knotifications-5.7.0/KF5NotificationsConfig.cmake.in 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/KF5NotificationsConfig.cmake.in 2015-03-07 15:47:35.000000000 +0100 @@ -1,6 +1,6 @@ @PACKAGE_INIT@ -set(KNOTIFICATIONS_DBUS_INTERFACES_DIR "${PACKAGE_PREFIX_DIR}/@DBUS_INTERFACES_INSTALL_DIR@") +set(KNOTIFICATIONS_DBUS_INTERFACES_DIR "@PACKAGE_KDE_INSTALL_DBUSINTERFACEDIR@") find_dependency(Qt5Widgets @REQUIRED_QT_VERSION@) find_dependency(KF5WindowSystem "@KF5_DEP_VERSION@") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/po/bs/knotifications5_qt.po new/knotifications-5.8.0/po/bs/knotifications5_qt.po --- old/knotifications-5.7.0/po/bs/knotifications5_qt.po 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/po/bs/knotifications5_qt.po 2015-03-07 15:47:35.000000000 +0100 @@ -1,73 +1,45 @@ -# translation of kdelibs4.po to bosanski -# Marko Rosic <[email protected]>, 2003. -# Toplica Tanaskovic <[email protected]>, 2003, 2004, 2005. -# Chusslove Illich <[email protected]>, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010. -# Dalibor Djuric <[email protected]>, 2009, 2010. -# Dalibor Djuric <[email protected]>, 2010. -# KDE 4 <[email protected]>, 2011. -# Bosnian translation of kdelibs4 -# Initially converted from translation of kdelibs4.po by -# Samir Ribić <[email protected]> msgid "" msgstr "" -"Project-Id-Version: kdelibs4\n" -"Report-Msgid-Bugs-To: http://bugs.kde.org\n" -"POT-Creation-Date: 2014-03-23 01:50+0000\n" -"PO-Revision-Date: 2013-12-21 17:26+0000\n" -"Last-Translator: Ademovic Saudin <[email protected]>\n" -"Language-Team: bosanski <[email protected]>\n" -"Language: bosnian\n" +"Project-Id-Version: kde5\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2015-02-24 19:44+0100\n" +"Last-Translator: Samir Ribić <[email protected]>\n" +"Language-Team: Bosnian\n" +"Language: bs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Qt-Contexts: true\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Launchpad (build 16872)\n" -"X-Launchpad-Export-Date: 2013-12-22 05:52+0000\n" -"X-Accelerator-Marker: &\n" -"X-Text-Markup: kde4\n" -"X-Environment: kde\n" -"X-Qt-Contexts: true\n" -# >> @item in message source specification #: knotificationrestrictions.cpp:184 -#, fuzzy -#| msgid "Unknown Application" msgctxt "KNotificationRestrictions|" msgid "Unknown Application" -msgstr "nepoznat program" +msgstr "Nepoznat program" #: kstatusnotifieritem.cpp:439 kstatusnotifieritem.cpp:879 -#, fuzzy -#| msgid "&Minimize" msgctxt "KStatusNotifierItem|" msgid "&Minimize" msgstr "&Minimizuj" #: kstatusnotifieritem.cpp:704 -#, fuzzy -#| msgid "Quit" msgctxt "KStatusNotifierItem|" msgid "Quit" msgstr "Izlaz" #: kstatusnotifieritem.cpp:877 -#, fuzzy -#| msgid "&Restore" msgctxt "KStatusNotifierItem|" msgid "&Restore" msgstr "&Obnovi" #: kstatusnotifieritem.cpp:891 -#, fuzzy, qt-format -#| msgid "<qt>Are you sure you want to quit <b>%1</b>?</qt>" +#, qt-format msgctxt "KStatusNotifierItem|" msgid "<qt>Are you sure you want to quit <b>%1</b>?</qt>" msgstr "<qt>Želite li zaista da napustite <b>%1</b>?</qt>" #: kstatusnotifieritem.cpp:894 -#, fuzzy -#| msgid "Confirm Quit From System Tray" msgctxt "KStatusNotifierItem|" msgid "Confirm Quit From System Tray" msgstr "Potvrdi napuštanje preko sistemske kasete" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/po/fr/knotifications5_qt.po new/knotifications-5.8.0/po/fr/knotifications5_qt.po --- old/knotifications-5.7.0/po/fr/knotifications5_qt.po 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/po/fr/knotifications5_qt.po 2015-03-07 15:47:35.000000000 +0100 @@ -24,10 +24,10 @@ "PO-Revision-Date: 2014-03-16 18:32+0100\n" "Last-Translator: Sebastien Renard <[email protected]>\n" "Language-Team: French <[email protected]>\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Lokalize 1.5\n" "X-Environment: kde\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/CMakeLists.txt new/knotifications-5.8.0/src/CMakeLists.txt --- old/knotifications-5.7.0/src/CMakeLists.txt 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/CMakeLists.txt 2015-03-07 15:47:35.000000000 +0100 @@ -22,6 +22,11 @@ ${knotifications_QM_LOADER} ) +if (Qt5TextToSpeech_FOUND) + set(knotifications_SRCS ${knotifications_SRCS} + notifybytts.cpp) +endif() + find_package(dbusmenu-qt5 CONFIG) set_package_properties(dbusmenu-qt5 PROPERTIES DESCRIPTION "DBusMenuQt" URL "https://launchpad.net/libdbusmenu-qt" TYPE OPTIONAL @@ -65,6 +70,10 @@ Qt5::DBus ) +if (Qt5TextToSpeech_FOUND) + target_link_libraries(KF5Notifications PRIVATE Qt5::TextToSpeech) +endif() + if(X11_FOUND) target_link_libraries(KF5Notifications PRIVATE ${X11_X11_LIB} Qt5::X11Extras) endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/knotification.h new/knotifications-5.8.0/src/knotification.h --- old/knotifications-5.7.0/src/knotification.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/knotification.h 2015-03-07 15:47:35.000000000 +0100 @@ -128,7 +128,7 @@ * Action is the string representing the action. Actions can be added to * KNotification as plugins, by deriving from KNotificationPlugin. * At the time of writing, the following actions are available: Taskbar, - * Sound, Popup, Logfile, KTTS, Execute. + * Sound, Popup, Logfile, TTS, Execute. * Actions can be combined by seperating them with '|'. * * Contexts is a comma separated list of possible context for this event. @@ -531,7 +531,7 @@ /** * reimplemented for internal reasons */ - virtual bool eventFilter(QObject *watched, QEvent *event); + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; public: /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/knotificationmanager.cpp new/knotifications-5.8.0/src/knotificationmanager.cpp --- old/knotifications-5.7.0/src/knotificationmanager.cpp 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/knotificationmanager.cpp 2015-03-07 15:47:35.000000000 +0100 @@ -36,6 +36,10 @@ #include "notifybytaskbar.h" #include "notifybyexecute.h" +#ifdef HAVE_SPEECH +#include "notifybytts.h" +#endif + typedef QHash<QString, QString> Dict; struct KNotificationManager::Private { @@ -74,7 +78,10 @@ #ifndef Q_OS_MAC addPlugin(new NotifyByTaskbar(this)); #endif -// addPlugin(new NotifyByKTTS(this)); + +#ifdef HAVE_SPEECH + addPlugin(new NotifyByTTS(this)); +#endif KService::List offers = KServiceTypeTrader::self()->query("KNotification/NotifyPlugin"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/knotifyconfig.cpp new/knotifications-5.8.0/src/knotifyconfig.cpp --- old/knotifications-5.7.0/src/knotifyconfig.cpp 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/knotifyconfig.cpp 2015-03-07 15:47:35.000000000 +0100 @@ -37,6 +37,7 @@ { QCache<QString, KSharedConfig::Ptr> &cache = *static_cache; if (cache.contains(filename)) { + (*cache[filename])->reparseConfiguration(); return *cache[filename]; } @@ -133,7 +134,7 @@ return QString(); } -QImage KNotifyImage::toImage() +QImage KNotifyImage::toImage() { if (dirty) { if (source.size() > 4) { // no way an image can fit in less than 4 bytes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/kpassivepopup.h new/knotifications-5.8.0/src/kpassivepopup.h --- old/knotifications-5.7.0/src/kpassivepopup.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/kpassivepopup.h 2015-03-07 15:47:35.000000000 +0100 @@ -341,7 +341,7 @@ void show(const QPoint &p); /** @reimp */ - virtual void setVisible(bool visible) Q_DECL_OVERRIDE; + void setVisible(bool visible) Q_DECL_OVERRIDE; Q_SIGNALS: /** @@ -388,13 +388,13 @@ void moveNear(const QRect &target); /** @reimp */ - virtual void hideEvent(QHideEvent *) Q_DECL_OVERRIDE; + void hideEvent(QHideEvent *) Q_DECL_OVERRIDE; /** @reimp */ - virtual void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; /** @reimp */ - virtual void paintEvent(QPaintEvent *pe) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *pe) Q_DECL_OVERRIDE; private: /* @internal */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/kstatusnotifieritem.h new/knotifications-5.8.0/src/kstatusnotifieritem.h --- old/knotifications-5.7.0/src/kstatusnotifieritem.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/kstatusnotifieritem.h 2015-03-07 15:47:35.000000000 +0100 @@ -396,7 +396,7 @@ void addAction(const QString &name, QAction *action); /** - * Removes an action to the collection + * Removes an action from the collection * * @param name the name of the action */ @@ -464,7 +464,7 @@ void secondaryActivateRequested(const QPoint &pos); protected: - bool eventFilter(QObject *watched, QEvent *event); + bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; private: KStatusNotifierItemPrivate *const d; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/kstatusnotifieritemprivate_p.h new/knotifications-5.8.0/src/kstatusnotifieritemprivate_p.h --- old/knotifications-5.7.0/src/kstatusnotifieritemprivate_p.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/kstatusnotifieritemprivate_p.h 2015-03-07 15:47:35.000000000 +0100 @@ -54,7 +54,7 @@ { } - bool event(QEvent *e) + bool event(QEvent *e) Q_DECL_OVERRIDE { if (e->type() == QEvent::Wheel) { QWheelEvent *wheelEvent = static_cast<QWheelEvent *>(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybyaudio.cpp new/knotifications-5.8.0/src/notifybyaudio.cpp --- old/knotifications-5.7.0/src/notifybyaudio.cpp 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybyaudio.cpp 2015-03-07 15:47:35.000000000 +0100 @@ -36,9 +36,9 @@ #include <phonon/audiooutput.h> NotifyByAudio::NotifyByAudio(QObject *parent) - : KNotificationPlugin(parent) + : KNotificationPlugin(parent), + m_audioOutput(nullptr) { - m_audioOutput = new Phonon::AudioOutput(Phonon::NotificationCategory, this); } NotifyByAudio::~NotifyByAudio() @@ -49,6 +49,9 @@ void NotifyByAudio::notify(KNotification *notification, KNotifyConfig *config) { + if (!m_audioOutput) { + m_audioOutput = new Phonon::AudioOutput(Phonon::NotificationCategory, this); + } QString soundFilename = config->readEntry("Sound"); if (soundFilename.isEmpty()) { qWarning() << "Audio notification requested, but no sound file provided in notifyrc file, aborting audio notification"; @@ -119,6 +122,7 @@ // this should call onAudioFinished() which also does finish() on the notification m->stop(); + m_reusablePhonons.append(m); } void NotifyByAudio::onAudioFinished() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybyaudio.h new/knotifications-5.8.0/src/notifybyaudio.h --- old/knotifications-5.7.0/src/notifybyaudio.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybyaudio.h 2015-03-07 15:47:35.000000000 +0100 @@ -43,9 +43,9 @@ NotifyByAudio(QObject *parent = 0); virtual ~NotifyByAudio(); - virtual QString optionName() { return QStringLiteral("Sound"); } - virtual void notify(KNotification *notification, KNotifyConfig *config); - virtual void close(KNotification *notification); + QString optionName() Q_DECL_OVERRIDE { return QStringLiteral("Sound"); } + void notify(KNotification *notification, KNotifyConfig *config) Q_DECL_OVERRIDE; + void close(KNotification *notification) Q_DECL_OVERRIDE; private Q_SLOTS: void onAudioFinished(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybyexecute.h new/knotifications-5.8.0/src/notifybyexecute.h --- old/knotifications-5.7.0/src/notifybyexecute.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybyexecute.h 2015-03-07 15:47:35.000000000 +0100 @@ -33,8 +33,8 @@ NotifyByExecute(QObject *parent = 0); virtual ~NotifyByExecute(); - virtual QString optionName() { return QStringLiteral("Execute"); } - virtual void notify(KNotification *notification, KNotifyConfig *config); + QString optionName() Q_DECL_OVERRIDE { return QStringLiteral("Execute"); } + void notify(KNotification *notification, KNotifyConfig *config) Q_DECL_OVERRIDE; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybyktts.cpp new/knotifications-5.8.0/src/notifybyktts.cpp --- old/knotifications-5.7.0/src/notifybyktts.cpp 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybyktts.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,102 +0,0 @@ -/* - Copyright (C) 2007 by Olivier Goffart <ogoffart at kde.org> - Copyright (C) 2009 by Laurent Montel <[email protected]> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see <http://www.gnu.org/licenses/>. - - */ -#include "notifybyktts.h" -#include <QtDBus/QtDBus> -#include <QHash> -#include <ktoolinvocation.h> -#include <kmessagebox.h> -#include <kmacroexpander.h> -#include <klocale.h> -#include <knotifyconfig.h> - -NotifyByKTTS::NotifyByKTTS(QObject *parent) : KNotificationPlugin(parent),m_kspeech(0), tryToStartKttsd( false ) -{ -} - - -NotifyByKTTS::~NotifyByKTTS() -{ -} - -void NotifyByKTTS::setupKttsd() -{ - m_kspeech = new org::kde::KSpeech("org.kde.kttsd", "/KSpeech", QDBusConnection::sessionBus()); - m_kspeech->setParent(this); - m_kspeech->setApplicationName("KNotify"); - - QDBusServiceWatcher *watcher = new QDBusServiceWatcher(this); - watcher->setConnection(QDBusConnection::sessionBus()); - watcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration); - watcher->addWatchedService("org.kde.kttsd"); - connect(watcher, SIGNAL(serviceUnregistered( const QString & ) ), this, SLOT( removeSpeech() )); -} - -void NotifyByKTTS::notify( int id, KNotifyConfig * config ) -{ - if( !m_kspeech) - { - if ( tryToStartKttsd ) //don't try to restart it all the time. - return; - // If KTTSD not running, start it. - if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kttsd")) - { - QString error; - if (KToolInvocation::startServiceByDesktopName("kttsd", QStringList(), &error)) - { - KMessageBox::error(0, i18n( "Starting Jovie Text-to-Speech Service Failed"), error ); - tryToStartKttsd = true; - return; - } - } - setupKttsd(); - } - - QString say = config->readEntry( "KTTS" ); - - if (!say.isEmpty()) { - QHash<QChar,QString> subst; - subst.insert( 'e', config->eventid ); - subst.insert( 'a', config->appname ); - subst.insert( 's', config->text ); - subst.insert( 'w', QString::number( (quintptr)config->winId )); - subst.insert( 'i', QString::number( id )); - subst.insert( 'm', config->text ); - say = KMacroExpander::expandMacrosShellQuote( say, subst ); - } - - if ( say.isEmpty() ) - say = config->text; // fallback - - m_kspeech->setApplicationName(config->appname); - m_kspeech->call(QDBus::NoBlock, "say", say, 0); - - finished(id); -} - -void NotifyByKTTS::removeSpeech() -{ - tryToStartKttsd = false; - - delete m_kspeech; - m_kspeech = 0; -} - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybyktts.h new/knotifications-5.8.0/src/notifybyktts.h --- old/knotifications-5.7.0/src/notifybyktts.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybyktts.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,53 +0,0 @@ -/* - Copyright (C) 2007 by Olivier Goffart <ogoffart at kde.org> - Copyright (C) 2009 by Laurent Montel <[email protected]> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see <http://www.gnu.org/licenses/>. - - */ - - - -#ifndef NOTIFYBYKTTS_H -#define NOTIFYBYKTTS_H - -#include "knotificationplugin.h" - -#include "kspeechinterface.h" - -class NotifyByKTTS : public KNotificationPlugin -{ - Q_OBJECT -public: - NotifyByKTTS(QObject *parent=0l); - virtual ~NotifyByKTTS(); - - virtual QString optionName() { return "KTTS"; } - virtual void notify(int id , KNotifyConfig *config); - -private slots: - void removeSpeech(); - -private: - void setupKttsd(); - -private: - org::kde::KSpeech *m_kspeech; - bool tryToStartKttsd; -}; - -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybylogfile.h new/knotifications-5.8.0/src/notifybylogfile.h --- old/knotifications-5.7.0/src/notifybylogfile.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybylogfile.h 2015-03-07 15:47:35.000000000 +0100 @@ -36,8 +36,8 @@ NotifyByLogfile(QObject *parent = 0); virtual ~NotifyByLogfile(); - virtual QString optionName() { return QStringLiteral("Logfile"); } - virtual void notify(KNotification *notification, KNotifyConfig *config); + QString optionName() Q_DECL_OVERRIDE { return QStringLiteral("Logfile"); } + void notify(KNotification *notification, KNotifyConfig *config) Q_DECL_OVERRIDE; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybypopup.cpp new/knotifications-5.8.0/src/notifybypopup.cpp --- old/knotifications-5.7.0/src/notifybypopup.cpp 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybypopup.cpp 2015-03-07 15:47:35.000000000 +0100 @@ -150,7 +150,7 @@ */ class HtmlEntityResolver : public QXmlStreamEntityResolver { - QString resolveUndeclaredEntity(const QString &name); + QString resolveUndeclaredEntity(const QString &name) Q_DECL_OVERRIDE; }; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybypopup.h new/knotifications-5.8.0/src/notifybypopup.h --- old/knotifications-5.7.0/src/notifybypopup.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybypopup.h 2015-03-07 15:47:35.000000000 +0100 @@ -40,13 +40,13 @@ NotifyByPopup(QObject *parent = 0l); virtual ~NotifyByPopup(); - virtual QString optionName() { return "Popup"; } - virtual void notify(KNotification *notification, KNotifyConfig *notifyConfig); - virtual void close(KNotification *notification); - virtual void update(KNotification *notification, KNotifyConfig *config); + QString optionName() Q_DECL_OVERRIDE { return "Popup"; } + void notify(KNotification *notification, KNotifyConfig *notifyConfig) Q_DECL_OVERRIDE; + void close(KNotification *notification) Q_DECL_OVERRIDE; + void update(KNotification *notification, KNotifyConfig *config) Q_DECL_OVERRIDE; protected: - void timerEvent(QTimerEvent *event); + void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; private Q_SLOTS: void onPassivePopupDestroyed(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybytaskbar.h new/knotifications-5.8.0/src/notifybytaskbar.h --- old/knotifications-5.7.0/src/notifybytaskbar.h 2015-02-08 16:22:06.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybytaskbar.h 2015-03-07 15:47:35.000000000 +0100 @@ -33,8 +33,8 @@ NotifyByTaskbar(QObject *parent = 0); virtual ~NotifyByTaskbar(); - virtual QString optionName() { return QStringLiteral("Taskbar"); } - virtual void notify(KNotification *notification, KNotifyConfig *config); + QString optionName() Q_DECL_OVERRIDE { return QStringLiteral("Taskbar"); } + void notify(KNotification *notification, KNotifyConfig *config) Q_DECL_OVERRIDE; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybytts.cpp new/knotifications-5.8.0/src/notifybytts.cpp --- old/knotifications-5.7.0/src/notifybytts.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybytts.cpp 2015-03-07 15:47:35.000000000 +0100 @@ -0,0 +1,72 @@ +/* + Copyright (C) 2007 by Olivier Goffart <ogoffart at kde.org> + Copyright (C) 2009 by Laurent Montel <[email protected]> + Copyright (C) 2015 by Jeremy Whiting <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. + + */ + +#include "notifybytts.h" +#include <QTextToSpeech> +#include <KMacroExpander> +#include "knotifyconfig.h" +#include "knotification.h" + +#include <QtDebug> + +NotifyByTTS::NotifyByTTS(QObject *parent) + : KNotificationPlugin(parent), + m_speech(0) +{ + m_speech = new QTextToSpeech(this); +} + + +NotifyByTTS::~NotifyByTTS() +{ + delete m_speech; + m_speech = 0; +} + +void NotifyByTTS::notify(KNotification *notification, KNotifyConfig *config ) +{ + if (m_speech->state() != QTextToSpeech::BackendError) { + QString say = config->readEntry( "TTS" ); + + if (!say.isEmpty()) { + // Create a hash of characters to strings to expand text into the notification text. + QHash<QChar,QString> subst; + subst.insert('e', notification->eventId()); + subst.insert('a', notification->appName()); + subst.insert('s', notification->text()); + //subst.insert('w', QString::number((quintptr)config->winId)); + //subst.insert('i', QString::number(id)); + subst.insert('m', notification->text()); + say = KMacroExpander::expandMacrosShellQuote( say, subst ); + } + + if (say.isEmpty()) + say = notification->text(); // fallback on the plain text + + m_speech->say(say); + + finished(notification); + } else { + qDebug() << "Speech backend has an error, not speaking"; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.7.0/src/notifybytts.h new/knotifications-5.8.0/src/notifybytts.h --- old/knotifications-5.7.0/src/notifybytts.h 1970-01-01 01:00:00.000000000 +0100 +++ new/knotifications-5.8.0/src/notifybytts.h 2015-03-07 15:47:35.000000000 +0100 @@ -0,0 +1,46 @@ +/* + Copyright (C) 2007 by Olivier Goffart <ogoffart at kde.org> + Copyright (C) 2009 by Laurent Montel <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. + + */ + + + +#ifndef NOTIFYBYTTS_H +#define NOTIFYBYTTS_H + +#include "knotificationplugin.h" + +class QTextToSpeech; + +class NotifyByTTS : public KNotificationPlugin +{ + Q_OBJECT +public: + NotifyByTTS(QObject *parent=0l); + virtual ~NotifyByTTS(); + + virtual QString optionName() { return "TTS"; } + virtual void notify(KNotification *notification, KNotifyConfig *config); + +private: + QTextToSpeech *m_speech; +}; + +#endif -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
