Changeset View
Changeset View
Standalone View
Standalone View
applets/devicenotifier/package/contents/ui/devicenotifier.qml
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | 108 | PlasmaCore.DataSource { | |||
---|---|---|---|---|---|
135 | } | 135 | } | ||
136 | 136 | | |||
137 | function isViableDevice(udi) { | 137 | function isViableDevice(udi) { | ||
138 | if (devicesType === "all") { | 138 | if (devicesType === "all") { | ||
139 | return true; | 139 | return true; | ||
140 | } | 140 | } | ||
141 | 141 | | |||
142 | var device = data[udi]; | 142 | var device = data[udi]; | ||
143 | if (!device) { | ||||
144 | return false; | ||||
145 | } | ||||
146 | | ||||
143 | return (devicesType === "removable" && device.Removable) | 147 | return (devicesType === "removable" && device.Removable) | ||
144 | || (devicesType === "nonRemovable" && !device.Removable); | 148 | || (devicesType === "nonRemovable" && !device.Removable); | ||
145 | } | 149 | } | ||
146 | 150 | | |||
147 | function processLastDevice(expand) { | 151 | function processLastDevice(expand) { | ||
148 | if (last) { | 152 | if (last) { | ||
149 | if (isViableDevice(last)) { | 153 | if (isViableDevice(last)) { | ||
150 | if (expand && hpSource.data[last].added) { | 154 | if (expand && hpSource.data[last].added) { | ||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 237 | function expandDevice(udi) { | |||
241 | 245 | | |||
242 | devicenotifier.popupIcon = "preferences-desktop-notification"; | 246 | devicenotifier.popupIcon = "preferences-desktop-notification"; | ||
243 | //plasmoid.expanded = true; | 247 | //plasmoid.expanded = true; | ||
244 | expandTimer.restart(); | 248 | expandTimer.restart(); | ||
245 | popupIconTimer.restart() | 249 | popupIconTimer.restart() | ||
246 | } | 250 | } | ||
247 | 251 | | |||
248 | function isMounted(udi) { | 252 | function isMounted(udi) { | ||
253 | if (!sdSource.data[udi]) { | ||||
254 | return false; | ||||
255 | } | ||||
256 | | ||||
249 | var types = sdSource.data[udi]["Device Types"]; | 257 | var types = sdSource.data[udi]["Device Types"]; | ||
250 | if (types.indexOf("Storage Access") >= 0) { | 258 | if (types.indexOf("Storage Access") >= 0) { | ||
251 | return sdSource.data[udi]["Accessible"]; | 259 | return sdSource.data[udi]["Accessible"]; | ||
252 | } | 260 | } | ||
253 | 261 | | |||
254 | return (types.indexOf("Storage Volume") >= 0 && types.indexOf("OpticalDisc") >= 0) | 262 | return (types.indexOf("Storage Volume") >= 0 && types.indexOf("OpticalDisc") >= 0) | ||
255 | } | 263 | } | ||
256 | 264 | | |||
Show All 18 Lines |