[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/network/kbluetooth/src
From:       Marco Martin <notmart () gmail ! com>
Date:       2009-10-30 14:44:47
Message-ID: 1256913887.978271.8500.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1042729 by mart:

conditionally ise KStatusNotifierItem


 M  +22 -10    trayicon.cpp  
 M  +12 -5     trayicon.h  


--- trunk/playground/network/kbluetooth/src/trayicon.cpp #1042728:1042729
@@ -27,12 +27,6 @@
 #include <QDesktopServices>
 #include <QClipboard>
 
-#if KDE_IS_VERSION(4,3,65)
-	#include <KNotificationItem>
-#else
-	#include <knotificationitem-1/knotificationitem.h>
-#endif
-
 #ifdef HAVE_NEPOMUK
 	#include <Nepomuk/ResourceManager>
 	#include <Nepomuk/Resource>
@@ -58,7 +52,12 @@
 #include <kwallet.h>
 
 using KWallet::Wallet;
-KBlueTray::KBlueTray(const QString& path, QObject* parent) : \
KNotificationItem(parent), agentPath(path),m_aboutDialog(0) \
+KBlueTray::KBlueTray(const QString& path, QObject* parent) : +#if KDE_IS_VERSION(4, \
3, 73) +KStatusNotifierItem(parent), agentPath(path),m_aboutDialog(0)
+#else
+KNotificationItem(parent), agentPath(path),m_aboutDialog(0)
+#endif
 {
 	adapter = 0;
 	server = 0;
@@ -76,7 +75,11 @@
 	setParent(kapp);
 	setIconByName("kbluetooth");
 	setToolTip("kbluetooth", "KBluetooth", "KDE bluetooth framework");
-	setCategory(KNotificationItem::Hardware);
+#if KDE_IS_VERSION(4, 3, 73)
+	setCategory(KStatusNotifierItem::Hardware);
+#else
+    setCategory(KNotificationItem::Hardware);
+#endif
 
 	//If the object already exists or can't be created, at least kdebug it
 	if(!QDBusConnection::systemBus().registerObject(agentPath, kapp)){
@@ -234,7 +237,11 @@
 	kDebug() << "adapter size " << \
Solid::Control::BluetoothManager::self().bluetoothInterfaces().size();  
 	online = true;
-	setStatus(KNotificationItem::Active);
+#if KDE_IS_VERSION(4, 3, 73)
+    setStatus(KStatusNotifierItem::Active);
+#else
+    setStatus(KNotificationItem::Active);
+#endif
 	setIconByPixmap( m_IconEnabled );
 
 	adapter = new Solid::Control::BluetoothInterface(man.defaultInterface());
@@ -291,7 +298,12 @@
 	kbluelockMenu->setEnabled(false);
 	settingsMenu->setEnabled(false);
 
-	setStatus(KNotificationItem::Passive);
+#if KDE_IS_VERSION(4, 3, 73)
+    setStatus(KStatusNotifierItem::Passive);
+#else
+    setStatus(KNotificationItem::Passive);
+#endif
+
 	setIconByPixmap( m_IconDisabled );
 
 	if (adapter) {
--- trunk/playground/network/kbluetooth/src/trayicon.h #1042728:1042729
@@ -21,7 +21,7 @@
 #ifndef KBLUETRAY_H
 #define KBLUETRAY_H
 
-#include "kdeversion.h"
+#include <kdeversion.h>
 #include "adapterconfig.h"
 #include "inputwizard/wizarddialog.h"
 #include "device-manager/devicemanager.h"
@@ -47,14 +47,21 @@
 #include <solid/control/bluetoothsecurity.h>
 #include <kwallet.h>
 
-#if KDE_IS_VERSION(4,3,65)
-	#include <KNotificationItem>
+#if KDE_IS_VERSION(4, 3, 73)
+    #include <KStatusNotifierItem>
+#elif KDE_IS_VERSION(4, 3, 65)
+    #include <KNotificationItem>
 #else
-	#include <knotificationitem-1/knotificationitem.h>
-	using namespace Experimental;
+    #include <knotificationitem-1/knotificationitem.h>
+    using namespace Experimental;
 #endif
 
+
+#if KDE_IS_VERSION(4, 3, 73)
+class KBlueTray : public KStatusNotifierItem
+#else
 class KBlueTray : public KNotificationItem
+#endif
 {
 Q_OBJECT
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic