fix: settings gpu enum
This commit is contained in:
@@ -25,18 +25,6 @@ PageBase {
|
||||
text: qsTr("None")
|
||||
}
|
||||
]
|
||||
readonly property list<string> gpuValues: ["", "NVIDIA", "GENERIC", "None"]
|
||||
|
||||
function gpuKeyToIndex(key: string): int {
|
||||
const u = (key ?? "").trim().toUpperCase();
|
||||
if (u === "")
|
||||
return 0; // Auto
|
||||
if (u === "NVIDIA")
|
||||
return 1;
|
||||
if (u === "GENERIC")
|
||||
return 2;
|
||||
return 3; // None
|
||||
}
|
||||
|
||||
title: qsTr("Services")
|
||||
|
||||
@@ -211,7 +199,7 @@ PageBase {
|
||||
}
|
||||
|
||||
SelectRow {
|
||||
active: root.gpuItems[root.gpuKeyToIndex(Config.services.gpuType)]
|
||||
active: root.gpuItems[Config.services.gpuType]
|
||||
last: true
|
||||
menuItems: root.gpuItems
|
||||
menuOnTop: true
|
||||
@@ -219,7 +207,7 @@ PageBase {
|
||||
subtext: Gpu.name ? qsTr("Monitoring: %1").arg(Gpu.name) : qsTr("Override for GPU type")
|
||||
text: qsTr("GPU")
|
||||
|
||||
onSelected: item => Config.services.gpuType = root.gpuValues[root.gpuItems.indexOf(item)]
|
||||
onSelected: item => Config.services.gpuType = root.gpuItems.indexOf(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user