Commit 4627aaf6 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Don't reset model when activeconnectionstate changed

Summary: resetting the model when a single property changes is using a sledgehammer to crack a nut. emitting dataChanged for the affected row is enough.

Test Plan:
(de)activated connections in plasmoid and mobile wifi KCM.
Verified with hotspot that lots of calls to modelReset disappeared

Reviewers: jgrulich

Reviewed By: jgrulich

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 5e9ff384
......@@ -601,13 +601,14 @@ void NetworkModel::activeConnectionStateChanged(NetworkManager::ActiveConnection
NetworkManager::ActiveConnection *activePtr = qobject_cast<NetworkManager::ActiveConnection*>(sender());
if (activePtr) {
for (NetworkModelItem *item : m_list.returnItems(NetworkItemsList::ActiveConnection, activePtr->path())) {
int row = m_list.indexOf(item);
Q_EMIT dataChanged(index(row, 0), index(row, 0));
qCDebug(PLASMA_NM) << "Item " << item->name() << ": active connection changed to " << item->connectionState();
Markdown is supported
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