Changeset View
Changeset View
Standalone View
Standalone View
libs/models/networkmodel.cpp
Show First 20 Lines • Show All 823 Lines • ▼ Show 20 Line(s) | 822 | { | |||
---|---|---|---|---|---|
824 | Q_UNUSED(reason); | 824 | Q_UNUSED(reason); | ||
825 | 825 | | |||
826 | NetworkManager::Device::Ptr device = NetworkManager::findNetworkInterface(qobject_cast<NetworkManager::Device*>(sender())->uni()); | 826 | NetworkManager::Device::Ptr device = NetworkManager::findNetworkInterface(qobject_cast<NetworkManager::Device*>(sender())->uni()); | ||
827 | 827 | | |||
828 | if (!device) { | 828 | if (!device) { | ||
829 | return; | 829 | return; | ||
830 | } | 830 | } | ||
831 | 831 | | |||
832 | beginResetModel(); | | |||
833 | for (NetworkModelItem *item : m_list.returnItems(NetworkItemsList::Device, device->uni())) { | 832 | for (NetworkModelItem *item : m_list.returnItems(NetworkItemsList::Device, device->uni())) { | ||
834 | item->setDeviceState(state); | 833 | item->setDeviceState(state); | ||
835 | item->invalidateDetails(); | 834 | updateItem(item); | ||
836 | // qCDebug(PLASMA_NM) << "Item " << item->name() << ": device state changed to " << item->deviceState(); | 835 | // qCDebug(PLASMA_NM) << "Item " << item->name() << ": device state changed to " << item->deviceState(); | ||
jgrulich: Please, see the comment in one of the other PRs. You can just use updateItem(item) and it will… | |||||
837 | } | 836 | } | ||
jgrulich: Shouldn't you add item->changedRoles() as the last parameter? | |||||
838 | endResetModel(); | | |||
839 | } | 837 | } | ||
840 | 838 | | |||
841 | #if WITH_MODEMMANAGER_SUPPORT | 839 | #if WITH_MODEMMANAGER_SUPPORT | ||
842 | void NetworkModel::gsmNetworkAccessTechnologiesChanged(QFlags<MMModemAccessTechnology> accessTechnologies) | 840 | void NetworkModel::gsmNetworkAccessTechnologiesChanged(QFlags<MMModemAccessTechnology> accessTechnologies) | ||
843 | { | 841 | { | ||
844 | Q_UNUSED(accessTechnologies); | 842 | Q_UNUSED(accessTechnologies); | ||
845 | ModemManager::Modem *gsmNetwork = qobject_cast<ModemManager::Modem*>(sender()); | 843 | ModemManager::Modem *gsmNetwork = qobject_cast<ModemManager::Modem*>(sender()); | ||
846 | if (!gsmNetwork) | 844 | if (!gsmNetwork) | ||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |
Please, see the comment in one of the other PRs. You can just use updateItem(item) and it will do everything for you. Sorry for not checking that earlier.