Commit 8aa96ac7 authored by Méven Car's avatar Méven Car

Solid-device-automounter/kcm: show disconnected known device when disconnecting it

Summary:
A user might find odd that when a known device in the UI is unmounted, it disappears.
Despite the fact that restarting the kcm would show it.

Test Plan:
Open `kcmshell5 device_automounter_kcm`
Plug in a usb stick, set a setting for it and Apply
Unplug the stick

Before:
The disconnected usb stick does not appear
After:
The usb stick appears at the bottom of the disconnected section

Forget the stick in the UI and Apply
Plug in the usb stick
Unplug it

The usb stick is not visible (as before)

Reviewers: broulik, #plasma, ervin, crossi, bport

Reviewed By: ervin, bport

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27024
parent 2837f74c
......@@ -95,11 +95,17 @@ void DeviceModel::deviceRemoved(const QString &udi)
m_attached.removeOne(udi);
endRemoveRows();
// NOTE the device is not moved to the "Disconnected" section
// when removing it while the KCM is opened because we need to check
// whether the device that just got detached is ignored
// We move the device to the "Disconnected" section only if it
// is a known device, meaning we have some setting for this device.
// Otherwise the device is not moved to the "Disconnected" section
// because we need to check whether the device that just got detached is ignored
// (don't show partition tables and other garbage) but this information
// is no longer available when the device is gone
// is no longer available once the device is gone
if (m_settings->knownDevices().contains(udi)) {
beginInsertRows(index(1, 0), m_disconnected.size(), m_disconnected.size());
m_disconnected << udi;
endInsertRows();
}
}
}
......
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