Changeset View
Changeset View
Standalone View
Standalone View
solid-device-automounter/kcm/DeviceModel.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | |||||
90 | { | 90 | { | ||
91 | if (m_attached.contains(udi)) { | 91 | if (m_attached.contains(udi)) { | ||
92 | const int deviceIndex = m_attached.indexOf(udi); | 92 | const int deviceIndex = m_attached.indexOf(udi); | ||
93 | 93 | | |||
94 | beginRemoveRows(index(0, 0), deviceIndex, deviceIndex); | 94 | beginRemoveRows(index(0, 0), deviceIndex, deviceIndex); | ||
95 | m_attached.removeOne(udi); | 95 | m_attached.removeOne(udi); | ||
96 | endRemoveRows(); | 96 | endRemoveRows(); | ||
97 | 97 | | |||
98 | // NOTE the device is not moved to the "Disconnected" section | 98 | // We move the device to the "Disconnected" section only if it | ||
99 | // when removing it while the KCM is opened because we need to check | 99 | // is a known device, meaning we have some setting for this device. | ||
100 | // whether the device that just got detached is ignored | 100 | // Otherwise the device is not moved to the "Disconnected" section | ||
101 | // because we need to check whether the device that just got detached is ignored | ||||
101 | // (don't show partition tables and other garbage) but this information | 102 | // (don't show partition tables and other garbage) but this information | ||
102 | // is no longer available when the device is gone | 103 | // is no longer available once the device is gone | ||
104 | if (m_settings->knownDevices().contains(udi)) { | ||||
ervin: I think we need a further update of the comment, indeed it starts with "the device is not moved… | |||||
105 | beginInsertRows(index(1, 0), m_disconnected.size(), m_disconnected.size()); | ||||
ervin: Missing space before { | |||||
106 | m_disconnected << udi; | ||||
107 | endInsertRows(); | ||||
108 | } | ||||
103 | } | 109 | } | ||
104 | } | 110 | } | ||
105 | 111 | | |||
106 | void DeviceModel::addNewDevice(const QString &udi) | 112 | void DeviceModel::addNewDevice(const QString &udi) | ||
107 | { | 113 | { | ||
108 | m_settings->load(); | 114 | m_settings->load(); | ||
109 | 115 | | |||
110 | if (!m_loginForced.contains(udi)) { | 116 | if (!m_loginForced.contains(udi)) { | ||
▲ Show 20 Lines • Show All 279 Lines • Show Last 20 Lines |
I think we need a further update of the comment, indeed it starts with "the device is not moved to"... but clearly not it is. I'd probably revert it with something like "We move the device for the disconnected section only if..." with then further explanations (some of the points mentioned can be kept). In its current form it's just more confusing