Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My working solution to #16 and #53 #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

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

function action_reloadSources() {
reloadAllSources()
}
Expand All @@ -190,10 +182,6 @@ Item {

temperatureModel.clear()

if (!systemmonitorSourcesToAdd) {
systemmonitorSourcesToAdd = []
}

if (systemmonitorDS.connectedSources === undefined) {
systemmonitorDS.connectedSources = []
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down