[Panel-devel] KDE/kdebase/workspace

Will Stephenson wstephenson at kde.org
Fri Nov 30 21:40:11 CET 2007


SVN commit 743389 by wstephens:

Complete the first fully working version of Solid::Networking network connection
status reporting.
*) Fix signals/slots
*) Change NM's Asleep status to Unconnected in the Solid model instead
of Unknown - this is what NM reports when you put it into offline mode
*) actually activate the damn thing (init() call in kded_networkstatus

The brave can test this using NetworkManager 0.6.x and Kopete by
enabling the 'Connect Automatically' checkbox in Kopete.  The timid can
just use the kdelibs/solid/tests/networkingclient to observe what the
Solid::Networking system would report to your app.

To Plasmoid developers: if your -oids uses the network, look into my
reddened eyes. You feel a strange compulsion to start connecting to
Solid::Networking::notifier()'s shouldConnect(), shouldDisconnect(), or
statusChanged() signals now.  When you wake up you will remember nothing
of this but carry out every instruction. *CLAP*
CCMAIL: panel-devel at kde.org


 M  +2 -2      libs/solid/control/networkmanager.cpp  
 M  +4 -1      solid/networking/kded/networkstatus.cpp  
 M  +0 -1      solid/networkmanager-0.6/CMakeLists.txt  
 M  +5 -5      solid/networkmanager-0.6/NetworkManager-networkmanager.cpp  


--- trunk/KDE/kdebase/workspace/libs/solid/control/networkmanager.cpp #743388:743389
@@ -42,8 +42,8 @@
                 this, SLOT(_k_networkInterfaceAdded(const QString &)));
         connect(managerBackend(), SIGNAL(networkInterfaceRemoved(const QString &)),
                 this, SLOT(_k_networkInterfaceRemoved(const QString &)));
-        connect(managerBackend(), SIGNAL(stateChanged(Solid::Networking::Status)),
-                this, SIGNAL(stateChanged(Solid::Control::Networking::Status)));
+        connect(managerBackend(), SIGNAL(statusChanged(Solid::Networking::Status)),
+                this, SIGNAL(statusChanged(Solid::Networking::Status)));
     }
 }
 
--- trunk/KDE/kdebase/workspace/solid/networking/kded/networkstatus.cpp #743388:743389
@@ -70,7 +70,7 @@
     QDBusConnectionInterface * sessionBus = dbus.interface();
 
     connect( sessionBus, SIGNAL(serviceOwnerChanged(const QString&,const QString&,const QString&)), this, SLOT(serviceOwnerChanged(const QString&,const QString&,const QString&)) );
-    //init();
+    init();
 }
 
 NetworkStatusModule::~NetworkStatusModule()
@@ -177,12 +177,15 @@
 void NetworkStatusModule::init()
 {
     d->notifier = Solid::Control::NetworkManager::notifier();
+    connect( d->notifier, SIGNAL(statusChanged(Solid::Networking::Status)),
+            this, SLOT(solidNetworkingStatusChanged(Solid::Networking::Status)));
     Solid::Networking::Status status = Solid::Control::NetworkManager::status();
     registerNetwork( QLatin1String("SolidNetwork"), status, QLatin1String("org.kde.kded") );
 }
 
 void NetworkStatusModule::solidNetworkingStatusChanged( Solid::Networking::Status status )
 {
+    kDebug( 1222 ) << "SolidNetwork changed status: " << status;
     setNetworkStatus( QLatin1String("SolidNetwork"), status );
 }
 
--- trunk/KDE/kdebase/workspace/solid/networkmanager-0.6/CMakeLists.txt #743388:743389
@@ -1,4 +1,3 @@
-message(status "NM-UTIL_INCLUDE_DIRS: ${NM-UTIL_INCLUDE_DIRS}")
 include_directories(${NETWORKMANAGER_INCLUDE_DIRS} ${NM-UTIL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../control)
 
 add_subdirectory(tests)
--- trunk/KDE/kdebase/workspace/solid/networkmanager-0.6/NetworkManager-networkmanager.cpp #743388:743389
@@ -199,21 +199,21 @@
     d->cachedState = state;
     switch ( d->cachedState ) {
         case NM_STATE_CONNECTING:
-            kDebug(1441) << "NMNetworkManager::stateChanged() Connecting";
+            kDebug(1441) << "NMNetworkManager::statusChanged() Connecting";
             emit statusChanged( Solid::Networking::Connecting );
             break;
         case NM_STATE_CONNECTED:
-            kDebug(1441) << "NMNetworkManager::stateChanged() CONNECTED";
+            kDebug(1441) << "NMNetworkManager::statusChanged() CONNECTED";
             emit statusChanged( Solid::Networking::Connected );
             break;
+        case NM_STATE_ASLEEP:
         case NM_STATE_DISCONNECTED:
-            kDebug(1441) << "NMNetworkManager::stateChanged() Unconnected";
+            kDebug(1441) << "NMNetworkManager::statusChanged() Unconnected";
             emit statusChanged( Solid::Networking::Unconnected );
             break;
         default:
         case NM_STATE_UNKNOWN:
-        case NM_STATE_ASLEEP:
-            kDebug(1441) << "NMNetworkManager::stateChanged() Unknown";
+            kDebug(1441) << "NMNetworkManager::statusChanged() Unknown";
             emit statusChanged( Solid::Networking::Unknown );
             break;
     }


More information about the Panel-devel mailing list