Changeset View
Changeset View
Standalone View
Standalone View
applets/devicenotifier/package/contents/ui/devicenotifier.qml
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 42 | } else { | |||
---|---|---|---|---|---|
43 | return "nonRemovable" | 43 | return "nonRemovable" | ||
44 | } | 44 | } | ||
45 | } | 45 | } | ||
46 | property string expandedDevice | 46 | property string expandedDevice | ||
47 | property string popupIcon: "device-notifier" | 47 | property string popupIcon: "device-notifier" | ||
48 | 48 | | |||
49 | property bool itemClicked: false | 49 | property bool itemClicked: false | ||
50 | property int currentIndex: -1 | 50 | property int currentIndex: -1 | ||
51 | property var mountedRemovables: [] | ||||
ngraham: mountedRemouvables -> mountedRemovables (and change all other instances, obviously) | |||||
thsurrel: I put too much French into this one ;) | |||||
En Anglais, les mots n'utilisent pas la lettre «u» aussi souvent qu'en Français. :) ngraham: En Anglais, les mots n'utilisent pas la lettre «u» aussi souvent qu'en Français. :) | |||||
thsurrel: Je ne savais pas que tu parlais français ! 👍 | |||||
Can this be done more declaratively? I'm not a huge fan of having the delegate (which may not even be created in case it is scrolled out of view) programmatically do this. I would at least opt for updating it in onDataChanged of the DataSource or onRowsAdded/onRowsRemoved or something along the lines of that broulik: Can this be done more declaratively? I'm not a huge fan of having the delegate (which may not… | |||||
51 | 52 | | |||
52 | // QTBUG-50380: As soon as the item gets removed from the model, all of ListView's | 53 | // QTBUG-50380: As soon as the item gets removed from the model, all of ListView's | ||
53 | // properties (count, contentHeight) pretend the delegate doesn't exist anymore | 54 | // properties (count, contentHeight) pretend the delegate doesn't exist anymore | ||
54 | // causing our "No devices" heading to overlap with the remaining device | 55 | // causing our "No devices" heading to overlap with the remaining device | ||
55 | property int pendingDelegateRemoval: 0 | 56 | property int pendingDelegateRemoval: 0 | ||
56 | 57 | | |||
57 | Plasmoid.switchWidth: units.gridUnit * 10 | 58 | Plasmoid.switchWidth: units.gridUnit * 10 | ||
58 | Plasmoid.switchHeight: units.gridUnit * 10 | 59 | Plasmoid.switchHeight: units.gridUnit * 10 | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 109 | PlasmaCore.DataSource { | |||
113 | property string last | 114 | property string last | ||
114 | onSourceAdded: { | 115 | onSourceAdded: { | ||
115 | disconnectSource(source); | 116 | disconnectSource(source); | ||
116 | connectSource(source); | 117 | connectSource(source); | ||
117 | last = source; | 118 | last = source; | ||
118 | processLastDevice(true); | 119 | processLastDevice(true); | ||
119 | } | 120 | } | ||
120 | 121 | | |||
121 | onSourceRemoved: { | 122 | onSourceRemoved: { | ||
broulik: This is for having the bindings refresh, right? | |||||
thsurrel: Yes indeed. Any better ways ? | |||||
Should be fine, I thought one needed to put it in a variable first var removables = devicenotifier.connectedRemovables; removables.push(source); devicenotifier.connectedRemovables = removables; broulik: Should be fine, I thought one needed to put it in a variable first
```
var removables =… | |||||
122 | if (expandedDevice == source) { | 123 | if (expandedDevice == source) { | ||
123 | expandedDevice = ""; | 124 | expandedDevice = ""; | ||
124 | } | 125 | } | ||
125 | disconnectSource(source); | 126 | disconnectSource(source); | ||
126 | } | 127 | } | ||
127 | 128 | | |||
128 | onDataChanged: { | 129 | onDataChanged: { | ||
129 | processLastDevice(true); | 130 | processLastDevice(true); | ||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |
mountedRemouvables -> mountedRemovables (and change all other instances, obviously)