Hello community, here is the log from the commit of package knotifications for openSUSE:Factory checked in at 2015-04-13 20:25:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-03-16 09:32:08.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.knotifications.new/knotifications.changes 2015-04-13 20:25:41.000000000 +0200 @@ -1,0 +2,13 @@ +Sat Apr 4 14:40:48 UTC 2015 - [email protected] + +- Update to 5.9.0 + * Added an event() version that takes no icon and will + use a default one + * Added an event() version that takes StandardEvent eventId + and QString iconName + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.9.0.php +- Drop no longer needed kwindowsystem-devel Requires of the + devel subpackage + +------------------------------------------------------------------- Old: ---- knotifications-5.8.0.tar.xz New: ---- knotifications-5.9.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ knotifications.spec ++++++ --- /var/tmp/diff_new_pack.fqlbYR/_old 2015-04-13 20:25:42.000000000 +0200 +++ /var/tmp/diff_new_pack.fqlbYR/_new 2015-04-13 20:25:42.000000000 +0200 @@ -16,23 +16,26 @@ # +%bcond_without lang %define lname libKF5Notifications5 -%define _tar_path 5.8 +%define _tar_path 5.9 Name: knotifications -Version: %{_tar_path}.0 +Version: 5.9.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.8.0 +BuildRequires: extra-cmake-modules >= %{_tar_path} BuildRequires: fdupes -BuildRequires: kcodecs-devel >= %{kf5_version} -BuildRequires: kconfig-devel >= %{kf5_version} -BuildRequires: kcoreaddons-devel >= %{kf5_version} +BuildRequires: kcodecs-devel >= %{_tar_path} +BuildRequires: kconfig-devel >= %{_tar_path} +BuildRequires: kcoreaddons-devel >= %{_tar_path} BuildRequires: kf5-filesystem -BuildRequires: kiconthemes-devel >= %{kf5_version} -BuildRequires: kservice-devel >= %{kf5_version} -BuildRequires: kwindowsystem-devel >= %{kf5_version} +BuildRequires: kiconthemes-devel >= %{_tar_path} +BuildRequires: kservice-devel >= %{_tar_path} +BuildRequires: kwindowsystem-devel >= %{_tar_path} +%if %{with lang} BuildRequires: libqt5-linguist-devel >= 5.2.0 +%endif BuildRequires: phonon4qt5-devel BuildRequires: pkgconfig(Qt5DBus) >= 5.2.0 BuildRequires: pkgconfig(Qt5Test) >= 5.2.0 @@ -55,7 +58,9 @@ %package -n %lname Summary: KDE Desktop notifications Group: System/GUI/KDE +%if %{with lang} Recommends: %lname-lang = %{version} +%endif %description -n %lname KNotification is used to notify the user of an event. It covers feedback and @@ -66,7 +71,6 @@ Group: Development/Libraries/KDE Requires: %lname = %{version} Requires: extra-cmake-modules -Requires: kwindowsystem-devel >= %{kf5_version} Requires: pkgconfig(Qt5Widgets) >= 5.2.0 %description devel @@ -83,15 +87,19 @@ %install %kf5_makeinstall -C build - %fdupes %{buildroot}%{_kf5_sharedir} + %fdupes %{buildroot} - %find_lang %{name}5 --with-qt --without-mo +%if %{with lang} +%find_lang %{name}5 --with-qt --without-mo +%endif %post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig +%if %{with lang} %files -n %lname-lang -f %{name}5.lang +%endif %files -n %lname %defattr(-,root,root) ++++++ knotifications-5.8.0.tar.xz -> knotifications-5.9.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.8.0/CMakeLists.txt new/knotifications-5.9.0/CMakeLists.txt --- old/knotifications-5.8.0/CMakeLists.txt 2015-03-07 15:47:35.000000000 +0100 +++ new/knotifications-5.9.0/CMakeLists.txt 2015-04-04 14:10:05.000000000 +0200 @@ -3,7 +3,7 @@ project(KNotifications) # ECM setup -find_package(ECM 1.8.0 REQUIRED NO_MODULE) +find_package(ECM 5.9.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.8.0") # handled by release scripts -set(KF5_DEP_VERSION "5.8.0") # handled by release scripts +set(KF5_VERSION "5.9.0") # handled by release scripts +set(KF5_DEP_VERSION "5.9.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KNOTIFICATIONS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.8.0/KF5NotificationsConfig.cmake.in new/knotifications-5.9.0/KF5NotificationsConfig.cmake.in --- old/knotifications-5.8.0/KF5NotificationsConfig.cmake.in 2015-03-07 15:47:35.000000000 +0100 +++ new/knotifications-5.9.0/KF5NotificationsConfig.cmake.in 2015-04-04 14:10:05.000000000 +0200 @@ -3,6 +3,5 @@ set(KNOTIFICATIONS_DBUS_INTERFACES_DIR "@PACKAGE_KDE_INSTALL_DBUSINTERFACEDIR@") find_dependency(Qt5Widgets @REQUIRED_QT_VERSION@) -find_dependency(KF5WindowSystem "@KF5_DEP_VERSION@") include("${CMAKE_CURRENT_LIST_DIR}/KF5NotificationsTargets.cmake") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.8.0/po/fr/knotifications5_qt.po new/knotifications-5.9.0/po/fr/knotifications5_qt.po --- old/knotifications-5.8.0/po/fr/knotifications5_qt.po 2015-03-07 15:47:35.000000000 +0100 +++ new/knotifications-5.9.0/po/fr/knotifications5_qt.po 2015-04-04 14:10:05.000000000 +0200 @@ -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.8.0/src/knotification.cpp new/knotifications-5.9.0/src/knotification.cpp --- old/knotifications-5.8.0/src/knotification.cpp 2015-03-07 15:47:35.000000000 +0100 +++ new/knotifications-5.9.0/src/knotification.cpp 2015-04-04 14:10:05.000000000 +0200 @@ -317,23 +317,8 @@ KNotification *KNotification::event(StandardEvent eventid, const QString &title, const QString &text, const QPixmap &pixmap, QWidget *widget, const NotificationFlags &flags) { - QString message; - switch (eventid) { - case Warning: - message = QLatin1String("warning"); - break; - case Error: - message = QLatin1String("fatalerror"); - break; - case Catastrophe: - message = QLatin1String("catastrophe"); - break; - case Notification: // fall through - default: - message = QLatin1String("notification"); - break; - } - return event(message, title, text, pixmap, widget, flags | DefaultEvent); + + return event(standardEventToEventId(eventid), title, text, pixmap, widget, flags | DefaultEvent); } KNotification *KNotification::event(StandardEvent eventid, const QString &text, @@ -357,6 +342,19 @@ return notify; } +KNotification *KNotification::event(StandardEvent eventid, const QString &title, const QString &text, + const QString &iconName, QWidget *widget, + const NotificationFlags &flags) +{ + return event(standardEventToEventId(eventid), title, text, iconName, widget, flags | DefaultEvent); +} + +KNotification* KNotification::event(StandardEvent eventid, const QString &title, const QString &text, + QWidget *widget, const NotificationFlags &flags) +{ + return event(standardEventToEventId(eventid), title, text, standardEventToIconName(eventid), widget, flags | DefaultEvent); +} + void KNotification::ref() { d->ref++; @@ -373,7 +371,7 @@ void KNotification::beep(const QString &reason, QWidget *widget) { - event(QLatin1String("beep"), reason, QPixmap(), widget, CloseOnTimeout | DefaultEvent); + event(QStringLiteral("beep"), reason, QPixmap(), widget, CloseOnTimeout | DefaultEvent); } void KNotification::sendEvent() @@ -396,7 +394,7 @@ QString appname; if (d->flags & DefaultEvent) { - appname = QLatin1String("plasma_workspace"); + appname = QStringLiteral("plasma_workspace"); } else if (!d->componentName.isEmpty()) { appname = d->componentName; } else { @@ -424,3 +422,46 @@ return false; } +QString KNotification::standardEventToEventId(KNotification::StandardEvent event) +{ + QString eventId; + switch (event) { + case Warning: + eventId = QStringLiteral("warning"); + break; + case Error: + eventId = QStringLiteral("fatalerror"); + break; + case Catastrophe: + eventId = QStringLiteral("catastrophe"); + break; + case Notification: // fall through + default: + eventId = QStringLiteral("notification"); + break; + } + return eventId; +} + + +QString KNotification::standardEventToIconName(KNotification::StandardEvent event) +{ + QString iconName; + switch (event) { + case Warning: + iconName = QStringLiteral("dialog-warning"); + break; + case Error: + iconName = QStringLiteral("dialog-error"); + break; + case Catastrophe: + iconName = QStringLiteral("dialog-error"); + break; + case Notification: // fall through + default: + iconName = QStringLiteral("dialog-information"); + break; + } + return iconName; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.8.0/src/knotification.h new/knotifications-5.9.0/src/knotification.h --- old/knotifications-5.8.0/src/knotification.h 2015-03-07 15:47:35.000000000 +0100 +++ new/knotifications-5.9.0/src/knotification.h 2015-04-04 14:10:05.000000000 +0200 @@ -532,6 +532,8 @@ * reimplemented for internal reasons */ bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + static QString standardEventToEventId(StandardEvent event); + static QString standardEventToIconName(StandardEvent event); public: /** @@ -616,7 +618,7 @@ * @since 4.4 */ static KNotification *event(StandardEvent eventId, const QString &title, const QString &text, - const QPixmap &pixmap = QPixmap(), QWidget *widget = 0L, + const QPixmap &pixmap, QWidget *widget = 0L, const NotificationFlags &flags = CloseOnTimeout); /** @@ -641,6 +643,43 @@ const QString &componentName = QString()); /** + * @brief emit a standard event with the possibility of setting an icon by icon name + * + * @overload + * + * This will emit a standard event with a custom icon + * + * @param eventId the type of the standard (not app-defined) event + * @param title is title of the notification to show in the popup. + * @param text is the text of the notification to show in the popup + * @param iconName a Freedesktop compatible icon name to be shown in the popup + * @param widget is a widget where the notification reports to + * @param flags is a bitmask of NotificationFlag + * @since 5.9 + */ + static KNotification *event(StandardEvent eventId, const QString &title, const QString &text, + const QString &iconName, QWidget *widget = 0L, + const NotificationFlags &flags = CloseOnTimeout); + + /** + * @brief emit a standard event + * + * @overload + * + * This will emit a standard event with its standard icon + * + * @param eventId the type of the standard (not app-defined) event + * @param title is title of the notification to show in the popup. + * @param text is the text of the notification to show in the popup + * @param widget is a widget where the notification reports to + * @param flags is a bitmask of NotificationFlag + * @since 5.9 + */ + static KNotification *event(StandardEvent eventId, const QString &title, const QString &text, + QWidget *widget = 0L, const NotificationFlags &flags = CloseOnTimeout); + + + /** * This is a simple substitution for QApplication::beep() * * @param reason a short text explaining what has happened (may be empty) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.8.0/src/kstatusnotifieritem.h new/knotifications-5.9.0/src/kstatusnotifieritem.h --- old/knotifications-5.8.0/src/kstatusnotifieritem.h 2015-03-07 15:47:35.000000000 +0100 +++ new/knotifications-5.9.0/src/kstatusnotifieritem.h 2015-04-04 14:10:05.000000000 +0200 @@ -356,7 +356,10 @@ * the menu will be shown with a contextMenu(int,int) * call by the systemtray over dbus * usually you don't need to call this unless you want to use - * a custom QMenu subclass as context menu + * a custom QMenu subclass as context menu. + * + * The KStatusNotifierItem instance takes ownerhip of the menu, + * and will delete it upon its destruction. */ void setContextMenu(QMenu *menu);
