[Device Notifier] Restore busy indicator

Summary:
This patch fixes two issues:
- the 'state' of the device now propagates correctly, that makes the busy indicator be displayed again, device emblems are also updated correctly
- there is no more delay between the moment when the device is actually mounted and the moment the device notifier says it is. The worst case used to be 5 seconds.

BUG: 354321
BUG: 399986

Reviewers: #plasma, #vdg, broulik, bruns, ngraham, davidedmundson

Reviewed By: #plasma, #vdg, ngraham, davidedmundson

Subscribers: mart, cfeck, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D16170
wilder-broken-krunner
Thomas Surrel 8 years ago
parent e1293e4c37
commit a7b2ecdb12
  1. 15
      applets/devicenotifier/package/contents/ui/DeviceItem.qml
  2. 2
      applets/devicenotifier/package/contents/ui/devicenotifier.qml

@ -119,6 +119,19 @@ MouseArea {
}
}
Timer {
id: updateStorageSpaceTimer
interval: 5000
repeat: true
running: mounted && plasmoid.expanded
triggeredOnStart: true // Update the storage space as soon as we open the plasmoid
onTriggered: {
var service = sdSource.serviceForSource(udi);
var operation = service.operationDescription("updateFreespace");
service.startOperationCall(operation);
}
}
RowLayout {
id: row
anchors.horizontalCenter: parent.horizontalCenter
@ -239,8 +252,6 @@ MouseArea {
font.pointSize: theme.smallestFont.pointSize
visible: deviceItem.state != 0 || (!actionsList.visible && !deviceItem.hasMessage)
text: {
// FIXME: state changes do not reach the plasmoid if the
// device was already attached when the plasmoid was initialized
if (deviceItem.state == 0) {
if (!hpSource.data[udi]) {
return ""

@ -109,7 +109,7 @@ Item {
id: sdSource
engine: "soliddevice"
connectedSources: hpSource.sources
interval: plasmoid.expanded ? 5000 : 0
interval: 0
property string last
onSourceAdded: {
disconnectSource(source);

Loading…
Cancel
Save