summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamarque V. Souza <lamarque@kde.org>2012-01-09 15:55:05 (GMT)
committerLamarque V. Souza <lamarque@kde.org>2012-01-09 15:55:05 (GMT)
commitd0ce3b783382016a0b6049a78066a5fdb089043b (patch)
tree3fc48428b5b2c25a587ff607f75b6be2c5e968cb
parentfbe6cb0176045bfa6166d38185e3c6caa2139818 (diff)
Delay statusChanged(Solid::Networking::Connected) signal a bit. It looks
like networking is not really connected right after networkstatus module receives the "Connected" signal from backend (tested with NetworkManager). CCBUG: 273342
-rw-r--r--solid-networkstatus/kded/networkstatus.cpp15
-rw-r--r--solid-networkstatus/kded/networkstatus.h1
2 files changed, 13 insertions, 3 deletions
diff --git a/solid-networkstatus/kded/networkstatus.cpp b/solid-networkstatus/kded/networkstatus.cpp
index 12376fd..fb83dbb 100644
--- a/solid-networkstatus/kded/networkstatus.cpp
+++ b/solid-networkstatus/kded/networkstatus.cpp
@@ -119,10 +119,19 @@ void NetworkStatusModule::updateStatus()
d->status = bestStatus;
if ( oldStatus != d->status ) {
- emit statusChanged( (uint)d->status );
+ if (d->status == Solid::Networking::Connected) {
+ QTimer::singleShot(2000, this, SLOT(delayedStatusChanged()));
+ } else {
+ emit statusChanged( (uint)d->status );
+ }
}
}
+void NetworkStatusModule::delayedStatusChanged()
+{
+ emit statusChanged( (uint)d->status );
+}
+
void NetworkStatusModule::serviceUnregistered( const QString & name )
{
// unregister and delete any networks owned by a service that has just unregistered
@@ -243,7 +252,7 @@ void NetworkStatusModule::init()
d->backendAppearedWatcher->setConnection(QDBusConnection::systemBus());
d->backendAppearedWatcher->setWatchMode(QDBusServiceWatcher::WatchForRegistration);
}
-
+
if ( d->backend == 0 ) {
// if none found watch for all backends registration.
for ( int i = 0; i < backends.count(); i++ ) {
@@ -264,7 +273,7 @@ void NetworkStatusModule::init()
d->backendDisappearedWatcher->addWatchedService(d->backend->serviceName());
connect(d->backendDisappearedWatcher, SIGNAL(serviceUnregistered(const QString &)), SLOT(backendUnregistered()));
}
-
+
connect( d->backend, SIGNAL(statusChanged(Solid::Networking::Status)),
this, SLOT(solidNetworkingStatusChanged(Solid::Networking::Status)));
Solid::Networking::Status status = d->backend->status();
diff --git a/solid-networkstatus/kded/networkstatus.h b/solid-networkstatus/kded/networkstatus.h
index 875dbf7..bf0873d 100644
--- a/solid-networkstatus/kded/networkstatus.h
+++ b/solid-networkstatus/kded/networkstatus.h
@@ -56,6 +56,7 @@ protected Q_SLOTS:
void solidNetworkingStatusChanged( Solid::Networking::Status status );
void backendRegistered();
void backendUnregistered();
+ void delayedStatusChanged();
protected:
// set up embedded backend
void init();