From kde-commits Fri Oct 30 14:44:47 2009 From: Marco Martin Date: Fri, 30 Oct 2009 14:44:47 +0000 To: kde-commits Subject: playground/network/kbluetooth/src Message-Id: <1256913887.978271.8500.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125691389816213 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 #include -#if KDE_IS_VERSION(4,3,65) - #include -#else - #include -#endif - #ifdef HAVE_NEPOMUK #include #include @@ -58,7 +52,12 @@ #include 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 #include "adapterconfig.h" #include "inputwizard/wizarddialog.h" #include "device-manager/devicemanager.h" @@ -47,14 +47,21 @@ #include #include -#if KDE_IS_VERSION(4,3,65) - #include +#if KDE_IS_VERSION(4, 3, 73) + #include +#elif KDE_IS_VERSION(4, 3, 65) + #include #else - #include - using namespace Experimental; + #include + using namespace Experimental; #endif + +#if KDE_IS_VERSION(4, 3, 73) +class KBlueTray : public KStatusNotifierItem +#else class KBlueTray : public KNotificationItem +#endif { Q_OBJECT