The QStringView::to<Number>() methods in Qt5 cause one extra allocation
compared to the QStringRef counter-part. As long as we aren't on a hot
path this is probably not worth the extra #ifdef though.
Apparently this was a KDE 4 feature that was lost in the Plasma 5 port.
I've re-implemented it using a notification, so it can be turned off or
customized if the user so desires. Kamoso does something similar.
BUG: 384469
FIXED-IN: 5.21
Summary:
Ejecting e.g. a USB stick removes it from the bus (bus power is removed),
but the last notification should be kept, otherwise a message like
"The device can be savely removed" immediately disappears.
Unfortunately it is almost impossible to tell when a device has been
physically removed (only indirectly, when a new device is plugged into
the same port), so allow some small leakage - in case the same device is
later replugged, no leakage happens.
Test Plan:
Card reader:
1.insert medium, mount, unmount
-> message "Device can be savely removed" is shown in device notifier
for 5 seconds
2. eject medium, reinsert
-> device appears without message and with default label
Reviewers: #plasma, broulik, ngraham
Reviewed By: ngraham
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22312
Summary:
Each notification was created as new datasource, and was newer removed
as long as the engine exists. This is especially bad for long living
applets like the device notifier. As there can only be one notification
per device (the last error state, or none), use the UDI as source name
and update the contents.
Also cancel (remove source) an old notifications in case of a successful
setup, otherwise old error messages are shown in the device notifier.
Test Plan:
in Dolphin, select "Release" (context menu) for a mounted CD
-> Notification in device notifier appears "Device can be safely removed"
remount without ejecting
-> Notification message is removed, device shows "mounted" emblem.
Without the change, the message stayed and the device kept the notification
emblem "(!)".
Reviewers: #frameworks, broulik
Reviewed By: broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15892
Instead of showing a detached status bar with the device name, show the message
below the device in the list.
When removing a device, device notifier will pop up and a "You can now safely remove
this device" message will show up with a highlight gradually fading away until 5 seconds
later the device is removed from the list.
REVIEW: 126688