mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-09 20:05:51 +00:00
return back stream lock which will be disabled from qml by the timer. In
other case there is possibe plasma crash
This commit is contained in:
@ -63,6 +63,8 @@ Item {
|
||||
"notify": plasmoid.configuration.notify
|
||||
}
|
||||
|
||||
signal connectPlugin
|
||||
signal disconnectPlugin
|
||||
signal dropSource(string sourceName)
|
||||
signal needTextUpdate(string newText)
|
||||
signal needToolTipUpdate(string newText)
|
||||
@ -87,11 +89,6 @@ Item {
|
||||
connectedSources: systemmonitorDE.sources
|
||||
interval: plasmoid.configuration.interval
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
|
||||
onSourceAdded: {
|
||||
if (debug) console.debug("Source", source)
|
||||
awKeys.addDevice(source)
|
||||
@ -103,11 +100,6 @@ Item {
|
||||
engine: "extsysmon"
|
||||
connectedSources: extsysmonDE.sources
|
||||
interval: plasmoid.configuration.interval
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaCore.DataSource {
|
||||
@ -115,11 +107,6 @@ Item {
|
||||
engine: "time"
|
||||
connectedSources: ["Local"]
|
||||
interval: 1000
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -173,6 +160,12 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
interval: 5 * plasmoid.configuration.interval
|
||||
onTriggered: connectPlugin()
|
||||
}
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
@ -184,13 +177,35 @@ Item {
|
||||
// init submodule
|
||||
Plasmoid.userConfiguringChanged(false)
|
||||
// connect data
|
||||
awKeys.disconnectPlugin.connect(disconnectPlugin)
|
||||
awKeys.dropSourceFromDataengine.connect(dropSource)
|
||||
awKeys.needTextToBeUpdated.connect(needTextUpdate)
|
||||
awKeys.needToolTipToBeUpdated.connect(needToolTipUpdate)
|
||||
connectPlugin()
|
||||
// check updates if required
|
||||
if (plasmoid.configuration.checkUpdates) return awActions.checkUpdates(false)
|
||||
}
|
||||
|
||||
onConnectPlugin: {
|
||||
if (debug) console.debug()
|
||||
|
||||
systemmonitorDE.newData.connect(awKeys.dataUpdateReceived)
|
||||
extsysmonDE.newData.connect(awKeys.dataUpdateReceived)
|
||||
timeDE.newData.connect(awKeys.dataUpdateReceived)
|
||||
|
||||
return awKeys.unlock()
|
||||
}
|
||||
|
||||
onDisconnectPlugin: {
|
||||
if (debug) console.debug()
|
||||
|
||||
systemmonitorDE.newData.disconnect(awKeys.dataUpdateReceived)
|
||||
extsysmonDE.newData.disconnect(awKeys.dataUpdateReceived)
|
||||
timeDE.newData.disconnect(awKeys.dataUpdateReceived)
|
||||
|
||||
return timer.start()
|
||||
}
|
||||
|
||||
onDropSource: {
|
||||
if (debug) console.debug()
|
||||
if (debug) console.debug("Source", sourceName)
|
||||
|
Reference in New Issue
Block a user