aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/kdenotify/kdenotify.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-10-31 10:18:54 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-10-31 10:18:54 +0000
commit3fa2bfef4093a9698edb49439fdfbb8d6f7cb451 (patch)
treedd28f90e6463678f38b0dc28b30bc967ddefea66 /src/plugins/General/kdenotify/kdenotify.cpp
parent9d2a0ffe435d0e871e82d7291f4844d1a7fe2efb (diff)
downloadqmmp-3fa2bfef4093a9698edb49439fdfbb8d6f7cb451.tar.gz
qmmp-3fa2bfef4093a9698edb49439fdfbb8d6f7cb451.tar.bz2
qmmp-3fa2bfef4093a9698edb49439fdfbb8d6f7cb451.zip
fixed kde notifications
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1342 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/kdenotify/kdenotify.cpp')
-rw-r--r--src/plugins/General/kdenotify/kdenotify.cpp36
1 files changed, 28 insertions, 8 deletions
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 <qmmp/soundcore.h>
-#include <qmmp/metadatamanager.h>
+/***************************************************************************
+ * 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 <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusInterface>
@@ -10,21 +27,24 @@
#include <QFileInfo>
#include <QDir>
#include <QSettings>
+#include <qmmp/soundcore.h>
+#include <qmmp/metadatamanager.h>
+#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()