From 3fa2bfef4093a9698edb49439fdfbb8d6f7cb451 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 31 Oct 2009 10:18:54 +0000 Subject: fixed kde notifications git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1342 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/kdenotify/kdenotify.cpp | 36 ++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'src/plugins/General/kdenotify/kdenotify.cpp') diff --git a/src/plugins/General/kdenotify/kdenotify.cpp b/src/plugins/General/kdenotify/kdenotify.cpp index 0b77c11f1..2dafa5df1 100644 --- a/src/plugins/General/kdenotify/kdenotify.cpp +++ b/src/plugins/General/kdenotify/kdenotify.cpp @@ -1,6 +1,23 @@ -#include "kdenotify.h" -#include -#include +/*************************************************************************** + * Copyright (C) 2009 by Artur Guzik * + * a.guzik88@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include #include #include @@ -10,21 +27,24 @@ #include #include #include +#include +#include +#include "kdenotify.h" KdeNotify::KdeNotify(QObject *parent) : General(parent) { - if (!QDBusConnection::sessionBus ().interface ()->isServiceRegistered ("org.kde.VisualNotifications")) + notifier = new QDBusInterface("org.kde.VisualNotifications", + "/VisualNotifications", "org.kde.VisualNotifications"); + if(notifier->isValid()) { - qWarning("KdeNotify: org.kde.VisualNotifications is not registered"); + qWarning("KdeNotify: unable to create dbus interface"); return; } - notifier = new QDBusInterface("org.kde.VisualNotifications", - "/VisualNotifications", "org.kde.VisualNotifications"); QSettings settings(Qmmp::configFile(),QSettings::IniFormat); settings.beginGroup("Kde_Notifier"); m_NotifyDelay = settings.value("notify_delay",10000).toInt(); settings.endGroup(); - connect(SoundCore::instance(),SIGNAL(metaDataChanged()),this,SLOT(showMetaData())); + connect(SoundCore::instance(),SIGNAL(metaDataChanged()), SLOT(showMetaData())); } KdeNotify::~KdeNotify() -- cgit v1.2.3-13-gbd6f