X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fknotificationbackend.cpp;h=4faea24c23ab38ba560f27034dfc2bcb3d27306f;hp=e7ba2d4c1b3c5a5c0a953d2a82b6f4d5808db1e0;hb=900cce213a6ed000b7131a05a0dec7d04b35b023;hpb=b7447afe8e836376776dac26704e227a678d2913 diff --git a/src/qtui/knotificationbackend.cpp b/src/qtui/knotificationbackend.cpp index e7ba2d4c..4faea24c 100644 --- a/src/qtui/knotificationbackend.cpp +++ b/src/qtui/knotificationbackend.cpp @@ -23,25 +23,21 @@ #include #include -#ifdef HAVE_KDE4 -# include -# include -#else -# include -# include -#endif +#include +#include #include "client.h" #include "icon.h" #include "mainwin.h" #include "networkmodel.h" #include "qtui.h" +#include "util.h" KNotificationBackend::KNotificationBackend(QObject *parent) : AbstractNotificationBackend(parent) { - connect(QtUi::mainWindow()->systemTray(), SIGNAL(activated(SystemTray::ActivationReason)), - SLOT(notificationActivated(SystemTray::ActivationReason))); + connect(QtUi::mainWindow()->systemTray(), &SystemTray::activated, + this, selectOverload(&KNotificationBackend::notificationActivated)); updateToolTip(); } @@ -61,16 +57,12 @@ void KNotificationBackend::notify(const Notification &n) type = "PrivMsgFocused"; break; } -#if QT_VERSION < 0x050000 - QString message = QString("<%1> %2").arg(n.sender, Qt::escape(n.message)); -#else QString message = QString("<%1> %2").arg(n.sender, n.message.toHtmlEscaped()); -#endif KNotification *notification = KNotification::event(type, message, icon::get("dialog-information").pixmap(48), QtUi::mainWindow(), KNotification::RaiseWidgetOnActivation |KNotification::CloseWhenWidgetActivated |KNotification::CloseOnTimeout); - connect(notification, SIGNAL(activated(uint)), SLOT(notificationActivated())); + connect(notification, selectOverload(&KNotification::activated), this, selectOverload<>(&KNotificationBackend::notificationActivated)); notification->setActions(QStringList("View")); notification->setProperty("notificationId", n.notificationId); @@ -154,7 +146,7 @@ KNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(_widget); - connect(_widget, SIGNAL(changed(bool)), SLOT(widgetChanged(bool))); + connect(_widget, &KNotifyConfigWidget::changed, this, &ConfigWidget::widgetChanged); }