Skip to content

Commit 11f8e91

Browse files
committed
fix: Non-built-in presets incorrectly marked as built-in
closes: #110
1 parent 9054b7a commit 11f8e91

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

package/contents/ui/configPresetAutoload.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ KCM.SimpleKCM {
1818
property string presetsBuiltinDir: Qt.resolvedUrl("./presets").toString().substring(7) + "/"
1919
property string toolsDir: Qt.resolvedUrl("./tools").toString().substring(7) + "/"
2020
property string listUserPresetsCmd: "'" + toolsDir + "list_presets.sh' '" + presetsDir + "'"
21-
property string listBuiltinPresetsCmd: "'" + toolsDir + "list_presets.sh' '" + presetsBuiltinDir + "'"
21+
property string listBuiltinPresetsCmd: "'" + toolsDir + "list_presets.sh' '" + presetsBuiltinDir + "' b"
2222
property string listPresetsCmd: listBuiltinPresetsCmd+";"+listUserPresetsCmd
2323

2424
property string cfg_presetAutoloading
@@ -39,7 +39,7 @@ KCM.SimpleKCM {
3939
Connections {
4040
target: runCommand
4141
function onExited(cmd, exitCode, exitStatus, stdout, stderr) {
42-
// console.log(cmd);
42+
console.error(cmd, exitCode, exitStatus, stdout, stderr)
4343
if (exitCode!==0) return
4444
// console.log(stdout);
4545
if(cmd === listPresetsCmd) {

package/contents/ui/configPresets.qml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ KCM.SimpleKCM {
1919
property string presetsBuiltinDir: Qt.resolvedUrl("./presets").toString().substring(7) + "/"
2020
property string toolsDir: Qt.resolvedUrl("./tools").toString().substring(7) + "/"
2121
property string listUserPresetsCmd: "'" + toolsDir + "list_presets.sh' '" + presetsDir + "'"
22-
property string listBuiltinPresetsCmd: "'" + toolsDir + "list_presets.sh' '" + presetsBuiltinDir + "'"
22+
property string listBuiltinPresetsCmd: "'" + toolsDir + "list_presets.sh' '" + presetsBuiltinDir + "' b"
2323
property string listPresetsCmd: listBuiltinPresetsCmd+";"+listUserPresetsCmd
2424
property string spectaclePreviewCmd: "spectacle -bn -r -o "
2525
property var presets: ({})
@@ -54,6 +54,7 @@ KCM.SimpleKCM {
5454
Connections {
5555
target: runCommand
5656
function onExited(cmd, exitCode, exitStatus, stdout, stderr) {
57+
console.error(cmd, exitCode, exitStatus, stdout, stderr)
5758
if (exitCode!==0) return
5859
if(cmd === listPresetsCmd) {
5960
presets = ({})
+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/env bash
22

33
PRESETS_DIR="$1"
4+
BUILTIN="$2"
45

5-
find "$PRESETS_DIR" -mindepth 1 -prune -type d -print0 | while IFS= read -r -d '' preset; do echo b:"$preset"; done | sort
6+
find "$PRESETS_DIR" -mindepth 1 -prune -type d -print0 | while IFS= read -r -d '' preset; do
7+
if [[ -n $BUILTIN ]]; then
8+
echo "b:$preset"
9+
else
10+
echo "u:$preset"
11+
fi
12+
done | sort

0 commit comments

Comments
 (0)