Changeset View
Changeset View
Standalone View
Standalone View
solid-device-automounter/kcm/DeviceModel.cpp
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | 134 | { | |||
---|---|---|---|---|---|
136 | m_loginForced.clear(); | 136 | m_loginForced.clear(); | ||
137 | m_attachedForced.clear(); | 137 | m_attachedForced.clear(); | ||
138 | m_attached.clear(); | 138 | m_attached.clear(); | ||
139 | m_disconnected.clear(); | 139 | m_disconnected.clear(); | ||
140 | 140 | | |||
141 | m_automaticLogin = AutomounterSettings::automountOnLogin(); | 141 | m_automaticLogin = AutomounterSettings::automountOnLogin(); | ||
142 | m_automaticAttached = AutomounterSettings::automountOnPlugin(); | 142 | m_automaticAttached = AutomounterSettings::automountOnPlugin(); | ||
143 | 143 | | |||
144 | foreach (const QString &dev, AutomounterSettings::knownDevices()) { | 144 | const auto knownDevices = AutomounterSettings::knownDevices(); | ||
145 | for (const QString &dev : knownDevices) { | ||||
145 | addNewDevice(dev); | 146 | addNewDevice(dev); | ||
146 | } | 147 | } | ||
147 | foreach (const QString &udi, m_loginForced.keys()) { | 148 | const auto keys = m_loginForced.keys(); | ||
149 | for (const QString &udi : keys) { | ||||
148 | m_loginForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Login); | 150 | m_loginForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Login); | ||
149 | m_attachedForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Attach); | 151 | m_attachedForced[udi] = AutomounterSettings::deviceAutomountIsForced(udi, AutomounterSettings::Attach); | ||
150 | } | 152 | } | ||
151 | endResetModel(); | 153 | endResetModel(); | ||
152 | } | 154 | } | ||
153 | 155 | | |||
154 | QModelIndex DeviceModel::index(int row, int column, const QModelIndex &parent) const | 156 | QModelIndex DeviceModel::index(int row, int column, const QModelIndex &parent) const | ||
155 | { | 157 | { | ||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |