aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/kdenotify/kdenotify.cpp
diff options
context:
space:
mode:
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()