Skip to content

Commit

Permalink
Fix Plasmashell crash when opening config kotelnik#69
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladdrako committed Nov 19, 2022
1 parent dcfd118 commit 4ec9e11
Showing 1 changed file with 47 additions and 45 deletions.
92 changes: 47 additions & 45 deletions package/contents/ui/config/ConfigTemperatures.qml
Original file line number Diff line number Diff line change
Expand Up @@ -524,72 +524,75 @@ Item {
engine: 'executable'

connectedSources: [ ModelUtils.UDISKS_DEVICES_CMD ]

property bool prepared: false

onNewData: {
connectedSources.length = 0

if (data['exit code'] > 0) {
print('New data incomming. Source: ' + sourceName + ', ERROR: ' + data.stderr);
return
}

print('New data incomming. Source: ' + sourceName + ', data: ' + data.stdout);

var pathsToCheck = ModelUtils.parseUdisksPaths(data.stdout)
pathsToCheck.forEach(function (pathObj) {
var cmd = ModelUtils.UDISKS_VIRTUAL_PATH_PREFIX + pathObj.name
comboboxModel.append({
text: cmd,
val: cmd
if (!prepared)
{
//connectedSources.length = 0

if (data['exit code'] > 0) {
print('New data incomming. Source: ' + sourceName + ', ERROR: ' + data.stderr);
return
}

print('New data incomming. Source: ' + sourceName + ', data: ' + data.stdout);

var pathsToCheck = ModelUtils.parseUdisksPaths(data.stdout)
pathsToCheck.forEach(function (pathObj) {
var cmd = ModelUtils.UDISKS_VIRTUAL_PATH_PREFIX + pathObj.name
comboboxModel.append({
text: cmd,
val: cmd
})
})
})

prepared = true
}
}

interval: 500
//interval: 500
}

PlasmaCore.DataSource {
id: nvidiaDS
engine: 'executable'

connectedSources: [ 'nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader' ]

property bool prepared: false

onNewData: {
nvidiaDS.connectedSources.length = 0

if (data['exit code'] > 0) {
if (!prepared)
{
//nvidiaDS.connectedSources.length = 0
if (data['exit code'] > 0) {
prepared = true
return
}

comboboxModel.append({
text: 'nvidia-smi',
val: 'nvidia-smi'
})
prepared = true
return
}

comboboxModel.append({
text: 'nvidia-smi',
val: 'nvidia-smi'
})

prepared = true
}

interval: 500
//interval: 500
}

PlasmaCore.DataSource {
id: atiDS
engine: 'executable'

connectedSources: [ 'aticonfig --od-gettemperature' ]

property bool prepared: false

onNewData: {
atiDS.connectedSources.length = 0

if (data['exit code'] > 0) {
prepared = true
return
if (!prepared)
{
//atiDS.connectedSources.length = 0
if (data['exit code'] > 0) {
prepared = true
return
}
}

comboboxModel.append({
Expand All @@ -599,8 +602,7 @@ Item {

prepared = true
}

interval: 500
//interval: 500
}

}

0 comments on commit 4ec9e11

Please sign in to comment.