Commit a8d87d38 authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Prevents a crazy flux of several networkDisappeared signals for the same ssid

when several Solid::Control::WirelessNetworkInterfaceEnvironment
objects are deleted during wifi or NetworkManager turning off. The end
result is the same as using wirelessEnabledChanged(false) but now there
is no signal being emitted.

CCBUG: 210878
parent 2c922bd2
......@@ -79,7 +79,31 @@ WirelessNetworkInterfaceActivatableProvider::WirelessNetworkInterfaceActivatable
WirelessNetworkInterfaceActivatableProvider::~WirelessNetworkInterfaceActivatableProvider()
{
Q_D(WirelessNetworkInterfaceActivatableProvider);
// remove WICs
QMultiHash<QString, Knm::InterfaceConnection*>::iterator i = d->activatables.begin();
while (i != d->activatables.end()) {
Knm::InterfaceConnection * ic = i.value();
if (ic->activatableType() == Knm::Activatable::WirelessInterfaceConnection ) {
Knm::WirelessInterfaceConnection * wic = static_cast<Knm::WirelessInterfaceConnection*>(ic);
d->activatableList->removeActivatable(ic);
i = d->activatables.erase(i);
delete wic;
} else {
++i;
}
}
// remove all WirelessNetwork
QHash<QString, Knm::WirelessNetwork *>::iterator w = d->wirelessNetworks.begin();
while (w != d->wirelessNetworks.end()) {
Knm::WirelessNetwork * wni = w.value();
d->activatableList->removeActivatable(wni);
delete wni;
++w;
}
}
void WirelessNetworkInterfaceActivatableProvider::handleAdd(Knm::Connection * addedConnection)
......
......@@ -66,7 +66,6 @@ Solid::Control::WirelessNetworkInterfaceEnvironment::WirelessNetworkInterfaceEnv
Solid::Control::WirelessNetworkInterfaceEnvironment::~WirelessNetworkInterfaceEnvironment()
{
kDebug();
wirelessEnabledChanged(false);
delete d_ptr;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment