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

List:       kde-commits
Subject:    playground/network/kbluetooth/src
From:       Alex Fiestas <alex () eyeos ! org>
Date:       2009-11-04 23:50:45
Message-ID: 1257378645.248070.17465.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1044941 by afiestas:

Thanks for port kbluetooth to the new KStatusNotifierItem. ATM because of the \
retrocompatibility I've replaced all the preprocesor if only bye 1 which have a \
typedef. It makes everything simpelr and easier until we drop the support for kde \
4.3.

 M  +10 -18    trayicon.cpp  
 M  +4 -8      trayicon.h  


--- trunk/playground/network/kbluetooth/src/trayicon.cpp #1044940:1044941
@@ -27,6 +27,13 @@
 #include <QDesktopServices>
 #include <QClipboard>
 
+#if KDE_IS_VERSION(4,3,65)
+	#include <KStatusNotifierItem>
+	typedef KStatusNotifierItem KNotificationItem;
+#else
+	#include <knotificationitem-1/knotificationitem.h>
+#endif
+
 #ifdef HAVE_NEPOMUK
 	#include <Nepomuk/ResourceManager>
 	#include <Nepomuk/Resource>
@@ -52,12 +59,7 @@
 #include <kwallet.h>
 
 using KWallet::Wallet;
-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
+KBlueTray::KBlueTray(const QString& path, QObject* parent) : \
KNotificationItem(parent), agentPath(path),m_aboutDialog(0)  {
 	adapter = 0;
 	server = 0;
@@ -75,11 +77,8 @@
 	setParent(kapp);
 	setIconByName("kbluetooth");
 	setToolTip("kbluetooth", "KBluetooth", "KDE bluetooth framework");
-#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)){
@@ -237,11 +236,8 @@
 	kDebug() << "adapter size " << \
Solid::Control::BluetoothManager::self().bluetoothInterfaces().size();  
 	online = true;
-#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());
@@ -298,11 +294,7 @@
 	kbluelockMenu->setEnabled(false);
 	settingsMenu->setEnabled(false);
 
-#if KDE_IS_VERSION(4, 3, 73)
-    setStatus(KStatusNotifierItem::Passive);
-#else
     setStatus(KNotificationItem::Passive);
-#endif
 
 	setIconByPixmap( m_IconDisabled );
 
--- trunk/playground/network/kbluetooth/src/trayicon.h #1044940:1044941
@@ -47,19 +47,15 @@
 #include <solid/control/bluetoothsecurity.h>
 #include <kwallet.h>
 
-#if KDE_IS_VERSION(4, 3, 73)
-    #define PARENT_ICON_CLASS KStatusNotifierItem
-    #include <KStatusNotifierItem>
-#elif KDE_IS_VERSION(4, 3, 65)
-    #define PARENT_ICON_CLASS KNotificationItem
-    #include <KNotificationItem>
+#if KDE_IS_VERSION(4,3,65)
+	#include <KStatusNotifierItem>
+	typedef KStatusNotifierItem KNotificationItem;
 #else
-    #define PARENT_ICON_CLASS KNotificationItem
     #include <knotificationitem-1/knotificationitem.h>
     using namespace Experimental;
 #endif
 
-class KBlueTray : public PARENT_ICON_CLASS
+class KBlueTray : public KNotificationItem
 {
 Q_OBJECT
 


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

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