Skip to content

Commit

Permalink
Update main.qml
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladdrako committed Nov 19, 2022
1 parent ea2bd45 commit dcfd118
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Item {
property double iconBottomMargin: itemHeight * plasmoid.configuration.iconBottomMargin * 0.01
property bool enableLabelDropShadow: plasmoid.configuration.enableLabelDropShadow

property var systemmonitorAvailableSources
property var systemmonitorSourcesToAdd
property var systemmonitorAvailableSources: []
property var systemmonitorSourcesToAdd: []

property int numberOfParts: temperatureModel.count

Expand Down Expand Up @@ -171,13 +171,6 @@ Item {
reloadAllSources()
}

function getSystemmonitorAvailableSources() {
if (!systemmonitorAvailableSources) {
systemmonitorAvailableSources = systemmonitorDS.sources
}
return systemmonitorAvailableSources
}

function action_reloadSources() {
reloadAllSources()
}
Expand All @@ -194,10 +187,6 @@ Item {
systemmonitorAvailableSources = []
}

if (!systemmonitorSourcesToAdd) {
systemmonitorSourcesToAdd = []
}

if (systemmonitorDS.connectedSources === undefined) {
systemmonitorDS.connectedSources = []
}
Expand Down Expand Up @@ -281,10 +270,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)
}
Expand Down Expand Up @@ -313,7 +304,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)
Expand Down

0 comments on commit dcfd118

Please sign in to comment.