diff --git a/solid-networkstatus/kded/CMakeLists.txt b/solid-networkstatus/kded/CMakeLists.txt index dd958423..89fb83f3 100644 --- a/solid-networkstatus/kded/CMakeLists.txt +++ b/solid-networkstatus/kded/CMakeLists.txt @@ -25,23 +25,6 @@ if(NETWORKMANAGER_FOUND) endif() endif(NETWORKMANAGER_FOUND) -macro_optional_find_package(QNtrack) -set_package_properties(QNtrack PROPERTIES DESCRIPTION "Network status tracking library" - URL "http://launchpad.net/ntrack" - TYPE OPTIONAL - PURPOSE "Provides data input for Solid network status" - ) - -if(QNTRACK_FOUND) - MESSAGE(STATUS "Found QNtrack, will use it as a data input for Solid network status") - set(kded_networkstatus_PART_SRCS ${kded_networkstatus_PART_SRCS} ntracknetworkstate.cpp) - add_definitions(-DHAVE_QNTRACK) -else(QNTRACK_FOUND) - MESSAGE(STATUS "QNtrack not found. Can be used as a data input to Solid network status. See https://launchpad.net/ntrack") -endif(QNTRACK_FOUND) - -include_directories(${QNTRACK_INCLUDE_DIR}) - qt4_add_dbus_adaptor(kded_networkstatus_PART_SRCS ../org.kde.Solid.Networking.Service.xml networkstatus.h NetworkStatusModule) @@ -55,10 +38,6 @@ kde4_add_plugin(kded_networkstatus ${kded_networkstatus_PART_SRCS}) target_link_libraries(kded_networkstatus ${KDE4_KDECORE_LIBS}) -if(QNTRACK_FOUND) - target_link_libraries(kded_networkstatus ${QNTRACK_LIBRARIES}) -endif(QNTRACK_FOUND) - install(TARGETS kded_networkstatus DESTINATION ${PLUGIN_INSTALL_DIR}) install( FILES networkstatus.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded) diff --git a/solid-networkstatus/kded/networkstatus.cpp b/solid-networkstatus/kded/networkstatus.cpp index 9c772ef2..d4773570 100644 --- a/solid-networkstatus/kded/networkstatus.cpp +++ b/solid-networkstatus/kded/networkstatus.cpp @@ -43,7 +43,6 @@ #include "wicdstatus.h" #include -#include "ntracknetworkstate.h" K_PLUGIN_FACTORY(NetworkStatusFactory, registerPlugin(); @@ -82,10 +81,6 @@ NetworkStatusModule::NetworkStatusModule(QObject* parent, const QList& new ClientAdaptor( this ); new ServiceAdaptor( this ); -#ifdef HAVE_QNTRACK - new NtrackNetworkState( this ); -#endif - init(); } diff --git a/solid-networkstatus/kded/ntracknetworkstate.cpp b/solid-networkstatus/kded/ntracknetworkstate.cpp deleted file mode 100644 index a5cbc70f..00000000 --- a/solid-networkstatus/kded/ntracknetworkstate.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (c) 2010 Sune Vuorela - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - -*/ - -#include "ntracknetworkstate.h" - -#include "networkstatus.h" - -#include - -#include - -Solid::Networking::Status ntrackstate2solidstatus(QNTrackState state) -{ - kDebug( 1222 ) << "ntrackstate2solidstatus changed status: " << state; - switch(state) { - case NTRACK_STATE_UNKNOWN: - case NTRACK_STATE_UNSET: { - return Solid::Networking::Unknown; - } - case NTRACK_STATE_ONLINE: { - return Solid::Networking::Connected; - } - case NTRACK_STATE_BLOCKED: - case NTRACK_STATE_OFFLINE: { - return Solid::Networking::Unconnected; - } - } - //FAILSAFE - return Solid::Networking::Unknown; -} - -NtrackNetworkState::NtrackNetworkState( NetworkStatusModule* statusmodule ) : QObject(statusmodule),m_statusmodule(statusmodule) -{ - m_statusmodule->registerNetwork("ntrack", ntrackstate2solidstatus(QNtrack::instance()->networkState()),"ntrack backend"); - connect(QNtrack::instance(),SIGNAL(stateChanged(QNTrackState,QNTrackState)),this,SLOT(ntrackStateChangedSlot(QNTrackState,QNTrackState))); -} - -NtrackNetworkState::~NtrackNetworkState() -{ -} - - - -void NtrackNetworkState::ntrackStateChangedSlot(QNTrackState /*oldstate*/ , QNTrackState newstate ) -{ - kDebug( 1222 ) << "ntrack changed status: " << newstate; - m_statusmodule->setNetworkStatus("ntrack",ntrackstate2solidstatus(newstate)); -} - - diff --git a/solid-networkstatus/kded/ntracknetworkstate.h b/solid-networkstatus/kded/ntracknetworkstate.h deleted file mode 100644 index 958f0913..00000000 --- a/solid-networkstatus/kded/ntracknetworkstate.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (c) 2010 Sune Vuorela - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - -*/ - -#ifndef NTRACKNETWORKSTATE_H -#define NTRACKNETWORKSTATE_H -#ifdef HAVE_QNTRACK - -#include -#include - -class NetworkStatusModule; - -class NtrackNetworkState : public QObject { - Q_OBJECT - public: - NtrackNetworkState(NetworkStatusModule* statusmodule /*also parent in object hierachy*/); - virtual ~NtrackNetworkState(); -private Q_SLOTS: - /** - * A slot to register the new state as reported by the ntrack part of things - */ - void ntrackStateChangedSlot(QNTrackState, QNTrackState newstate); - private: - NetworkStatusModule* m_statusmodule; -}; - -#endif // HAVE_QNTRACK -#endif // NTRACKNETWORKSTATE_H