Changeset View
Changeset View
Standalone View
Standalone View
solid-device-automounter/kcm/DeviceModel.cpp
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | |||||
127 | void DeviceModel::reload() | 127 | void DeviceModel::reload() | ||
128 | { | 128 | { | ||
129 | beginResetModel(); | 129 | beginResetModel(); | ||
130 | m_loginForced.clear(); | 130 | m_loginForced.clear(); | ||
131 | m_attachedForced.clear(); | 131 | m_attachedForced.clear(); | ||
132 | m_attached.clear(); | 132 | m_attached.clear(); | ||
133 | m_disconnected.clear(); | 133 | m_disconnected.clear(); | ||
134 | 134 | | |||
135 | foreach (const QString &dev, AutomounterSettings::knownDevices()) { | 135 | const auto knownDevices = AutomounterSettings::knownDevices(); | ||
136 | for (const QString &dev : knownDevices) { | ||||
136 | addNewDevice(dev); | 137 | addNewDevice(dev); | ||
137 | } | 138 | } | ||
138 | foreach (const QString &udi, m_loginForced.keys()) { | 139 | const auto keys = m_loginForced.keys(); | ||
140 | for (const QString &udi : keys) { | ||||
139 | m_loginForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Login); | 141 | m_loginForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Login); | ||
140 | m_attachedForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Attach); | 142 | m_attachedForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Attach); | ||
141 | } | 143 | } | ||
142 | endResetModel(); | 144 | endResetModel(); | ||
143 | } | 145 | } | ||
144 | 146 | | |||
145 | QModelIndex DeviceModel::index(int row, int column, const QModelIndex &parent) const | 147 | QModelIndex DeviceModel::index(int row, int column, const QModelIndex &parent) const | ||
146 | { | 148 | { | ||
▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines |