diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 67e3f4c..5c2bca2 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -55,8 +55,7 @@ Item { property double iconBottomMargin: itemHeight * plasmoid.configuration.iconBottomMargin * 0.01 property bool enableLabelDropShadow: plasmoid.configuration.enableLabelDropShadow - property var systemmonitorAvailableSources - property var systemmonitorSourcesToAdd + property var systemmonitorSourcesToAdd: [] property int numberOfParts: temperatureModel.count @@ -171,13 +170,6 @@ Item { reloadAllSources() } - function getSystemmonitorAvailableSources() { - if (!systemmonitorAvailableSources) { - systemmonitorAvailableSources = systemmonitorDS.sources - } - return systemmonitorAvailableSources - } - function action_reloadSources() { reloadAllSources() } @@ -190,10 +182,6 @@ Item { temperatureModel.clear() - if (!systemmonitorSourcesToAdd) { - systemmonitorSourcesToAdd = [] - } - if (systemmonitorDS.connectedSources === undefined) { systemmonitorDS.connectedSources = [] } @@ -277,10 +265,12 @@ Item { dbgprint('adding source to systemmonitorDS: ' + source) - if (getSystemmonitorAvailableSources().indexOf(source) > -1) { + if (systemmonitorDS.sources.indexOf(source) > -1) { + // this is an existing source of systemmonitorDS so we can connect it dbgprint('adding to connected') addToSourcesOfDatasource(systemmonitorDS, source) } else { + // the source does not exist in systemmonitorDS (yet...) so we can't add yet it but we store it to add it if it appears later dbgprint('adding to sta') systemmonitorSourcesToAdd.push(source) } @@ -309,7 +299,6 @@ Item { if (source.indexOf(lmSensorsStart) === 0 || source.indexOf(acpiStart) === 0) { - systemmonitorAvailableSources.push(source) var staIndex = systemmonitorSourcesToAdd.indexOf(source) if (staIndex > -1) { addToSourcesOfDatasource(systemmonitorDS, source)