Changeset View
Changeset View
Standalone View
Standalone View
applets/devicenotifier/package/contents/ui/devicenotifier.qml
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 130 | onSourceRemoved: { | |||
---|---|---|---|---|---|
134 | disconnectSource(source); | 134 | disconnectSource(source); | ||
135 | var index = devicenotifier.connectedRemovables.indexOf(source); | 135 | var index = devicenotifier.connectedRemovables.indexOf(source); | ||
136 | if (index >= 0) { | 136 | if (index >= 0) { | ||
137 | devicenotifier.connectedRemovables.splice(index, 1); | 137 | devicenotifier.connectedRemovables.splice(index, 1); | ||
138 | devicenotifier.connectedRemovables = devicenotifier.connectedRemovables; | 138 | devicenotifier.connectedRemovables = devicenotifier.connectedRemovables; | ||
139 | } | 139 | } | ||
140 | } | 140 | } | ||
141 | 141 | | |||
142 | onDataChanged: { | 142 | function onDataChanged() { | ||
143 | processLastDevice(true); | 143 | processLastDevice(true); | ||
144 | var counter = 0; | 144 | var counter = 0; | ||
145 | for (var i = 0; i < devicenotifier.connectedRemovables.length; i++) { | 145 | for (var i = 0; i < devicenotifier.connectedRemovables.length; i++) { | ||
146 | if (isMounted(devicenotifier.connectedRemovables[i])) { | 146 | if (isMounted(devicenotifier.connectedRemovables[i])) { | ||
147 | counter++; | 147 | counter++; | ||
148 | } | 148 | } | ||
149 | } | 149 | } | ||
150 | if (counter !== devicenotifier.mountedRemovables) { | 150 | if (counter !== devicenotifier.mountedRemovables) { | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 205 | PlasmaCore.DataSource { | |||
208 | property string last | 208 | property string last | ||
209 | property string lastUdi | 209 | property string lastUdi | ||
210 | onSourceAdded: { | 210 | onSourceAdded: { | ||
211 | last = source; | 211 | last = source; | ||
212 | disconnectSource(source); | 212 | disconnectSource(source); | ||
213 | connectSource(source); | 213 | connectSource(source); | ||
214 | } | 214 | } | ||
215 | onSourceRemoved: disconnectSource(source) | 215 | onSourceRemoved: disconnectSource(source) | ||
216 | onDataChanged: { | 216 | function onDataChanged() { | ||
217 | if (last) { | 217 | if (last) { | ||
218 | lastUdi = data[last].udi | 218 | lastUdi = data[last].udi | ||
219 | 219 | | |||
220 | if (sdSource.isViableDevice(lastUdi)) { | 220 | if (sdSource.isViableDevice(lastUdi)) { | ||
221 | plasmoid.expanded = true | 221 | plasmoid.expanded = true | ||
222 | plasmoid.fullRepresentationItem.spontaneousOpen = true; | 222 | plasmoid.fullRepresentationItem.spontaneousOpen = true; | ||
223 | } | 223 | } | ||
224 | } | 224 | } | ||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |