Use KMenu for the kdenotification plugin if ENABLE_KNOTIFICATIONS isn't enabled
This commit is contained in:
@@ -10,6 +10,7 @@ INCLUDEPATH += src/
|
||||
greaterThan(QT_MAJOR_VERSION, 4): ENABLE_KNOTIFICATIONS {
|
||||
message("Enabling KDE5 notifications")
|
||||
QT += KNotifications
|
||||
DEFINES += ENABLE_KNOTIFICATIONS=1
|
||||
} else {
|
||||
LIBS += -lkdeui
|
||||
}
|
||||
|
@@ -156,15 +156,9 @@ void MainWidget::connectSignals()
|
||||
|
||||
void MainWidget::setTrayTooltip(QString message)
|
||||
{
|
||||
#ifndef ENABLE_KDE_NOTIFIER
|
||||
if(trayIcon) {
|
||||
trayIcon->setToolTip(message);
|
||||
}
|
||||
#else
|
||||
if(notifierItem) {
|
||||
notifierItem->setToolTipSubTitle(message);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWidget::openManager()
|
||||
|
@@ -30,9 +30,6 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include <QSystemTrayIcon>
|
||||
#ifdef ENABLE_KDE_NOTIFIER
|
||||
#include "kdenotifier.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#include <QDBusConnection>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "kdenotifiertray.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
#ifndef ENABLE_KNOTIFICATIONS
|
||||
#include <kmenu.h>
|
||||
#else
|
||||
#include <QMenu>
|
||||
@@ -45,7 +45,7 @@ void KDENotifierTray::init()
|
||||
connect(about_qt, SIGNAL(triggered()), this, SIGNAL(showAboutQt()));
|
||||
connect(quit, SIGNAL(triggered()), this, SIGNAL(stopServer()));
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
#ifndef ENABLE_KNOTIFICATIONS
|
||||
KMenu *tray_icon_menu = new KMenu(this);
|
||||
#else
|
||||
QMenu *tray_icon_menu = new QMenu(this);
|
||||
|
@@ -47,14 +47,7 @@ private:
|
||||
QAction *about;
|
||||
QAction *about_qt;
|
||||
|
||||
#ifndef ENABLE_KDE_NOTIFIER
|
||||
QSystemTrayIcon *m_tray_icon;
|
||||
#else
|
||||
KDENotifier *m_notifier_item;
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // QTRAYICON_H
|
||||
|
Reference in New Issue
Block a user