diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,6 @@ knotifyconfig.cpp knotificationplugin.cpp - notifybypopupgrowl.cpp notifybyexecute.cpp notifybylogfile.cpp notifybytaskbar.cpp diff --git a/src/notifybypopup.cpp b/src/notifybypopup.cpp --- a/src/notifybypopup.cpp +++ b/src/notifybypopup.cpp @@ -23,7 +23,6 @@ #include "notifybypopup.h" #include "imageconverter.h" -#include "notifybypopupgrowl.h" #include "kpassivepopup.h" #include "knotifyconfig.h" @@ -240,32 +239,6 @@ // CloseOnTimeout => -1 == let the server decide int timeout = (notification->flags() & KNotification::Persistent) ? 0 : -1; - // if Growl can display our popups, use that instead - if (NotifyByPopupGrowl::canPopup()) { - - QString appCaption, iconName; - d->getAppCaptionAndIconName(notifyConfig, &appCaption, &iconName); - appCaption = d->stripHtml(appCaption); - - //did the user override the icon name? - if (!notification->iconName().isEmpty()) { - iconName = notification->iconName(); - } - - // Our growl implementation does not support html stuff - // so strip it off right away - QString text = notification->text(); - text = d->stripHtml(text); - - // The first arg is QPixmap*, however that pixmap is not used - // at all (it has Q_UNUSED) so just set it to 0 - NotifyByPopupGrowl::popup(nullptr, timeout, appCaption, text); - - // Finish immediately, because current NotifyByPopupGrowl can't callback - finish(notification); - return; - } - // Check if this object lives in the GUI thread and return if it doesn't // as Qt cannot create/handle widgets in non-GUI threads if (QThread::currentThread() != qApp->thread()) { @@ -401,11 +374,6 @@ d->sendNotificationToGalagoServer(notification, notifyConfig, true); return; } - - // otherwise, just display a new Growl notification - if (NotifyByPopupGrowl::canPopup()) { - notify(notification, notifyConfig); - } } void NotifyByPopup::onServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner) @@ -801,13 +769,9 @@ void NotifyByPopupPrivate::queryPopupServerCapabilities() { if (!dbusServiceExists) { - if (NotifyByPopupGrowl::canPopup()) { - popupServerCapabilities = NotifyByPopupGrowl::capabilities(); - } else { - // Return capabilities of the KPassivePopup implementation - popupServerCapabilities = QStringList() << QStringLiteral("actions") << QStringLiteral("body") << QStringLiteral("body-hyperlinks") + // Return capabilities of the KPassivePopup implementation + popupServerCapabilities = QStringList() << QStringLiteral("actions") << QStringLiteral("body") << QStringLiteral("body-hyperlinks") << QStringLiteral("body-markup") << QStringLiteral("icon-static"); - } } if (dbusServiceCapCacheDirty) { diff --git a/src/notifybypopupgrowl.h b/src/notifybypopupgrowl.h deleted file mode 100644 --- a/src/notifybypopupgrowl.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2010 by Sjors Gielen - - 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 . - - */ - -#ifndef NOTIFYBYPOPUPGROWL_H -#define NOTIFYBYPOPUPGROWL_H - -#include -#include - -/** - * @brief Display a notification using Growl. - * - * Currently, this class uses QSystemTrayIcon to actually display the - * notification. Inside the Growl project, a protocol is being developed - * to display notifications; this protocol is currently only implemented - * (partly) in the Windows version of Growl. Once it is finished, it will be - * implemented in KNotify and used instead. - * (The normal Growl API is written in Objective C. It's possible to use it, - * but it's a lot harder than just waiting for GNTP to stabilize.) - */ -class NotifyByPopupGrowl -{ -public: - static bool canPopup(); - static QStringList capabilities(); - static void popup(const QPixmap *icon, int timeout, - const QString &title, const QString &message); -}; - -#endif // NOTIFYBYPOPUPGROWL_H diff --git a/src/notifybypopupgrowl.cpp b/src/notifybypopupgrowl.cpp deleted file mode 100644 --- a/src/notifybypopupgrowl.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2010 by Sjors Gielen - - 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 . - - */ - -#include "notifybypopupgrowl.h" -#include -#include - -#define GROWL_LOCATION_MACOSX "/Library/PreferencePanes/Growl.prefPane/Contents/MacOS/Growl" -#define GROWL_LOCATION_WIN32 "C:/Program Files/Growl for Windows/Growl.exe" - -/** - * @brief Check if Growl can display plugins. - * Currently, this checks only if Growl is installed, not if it's running. - * As soon as the Growl Notification Protocol is finished, it will be - * implemented and used for this check. - */ -bool NotifyByPopupGrowl::canPopup() -{ - return QFile::exists(QStringLiteral(GROWL_LOCATION_MACOSX)) - || QFile::exists(QStringLiteral(GROWL_LOCATION_WIN32)); -} - -/** - * @brief Get the capabilities supported by Growl. - */ -QStringList NotifyByPopupGrowl::capabilities() -{ - return QStringList(); -} - -/** - * @brief Send a popup through Growl. - * @param icon The icon inside the notification. Currently ignored. - * @param timeout The time in ms to show the notification. - * @param title The title displayed inside the notification. - * @param message The message displayed inside the notification. - */ -void NotifyByPopupGrowl::popup(const QPixmap *icon, int timeout, - const QString &title, const QString &message ) -{ - Q_UNUSED(icon); - - QSystemTrayIcon i; - i.show(); - i.showMessage(title, message, - QSystemTrayIcon::Information, timeout); - i.hide(); -}