[plasma-mobile/qmlkonsole/release/26.08] lib: Search external directories for custom color schemes

Devin Lin <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit cd91b920ce1a274da1b3321a3be032f2a9673385 by Devin Lin, on behalf of Perry Gibson.
Committed on 19/07/2026 at 04:53.
Pushed by devinlin into branch 'release/26.08'.

Search external directories for custom color schemes

`colorSchemesDirs()` only returned the embedded Qt resource path,
making it impossible to use custom `.colorscheme` files from
`~/.local/share/konsole/` or `/usr/share/konsole/`.

The `add_custom_color_scheme_dir()` function and `custom_color_schemes_dirs`
list existed but were never included in the search paths.

Now searches:
1. Embedded Qt resources (bundled schemes)
2. `~/.local/share/konsole/` (user schemes)
3. `/usr/share/konsole/` (system schemes)
4. Any paths added via `add_custom_color_scheme_dir()`

BUG: 517478

M  +5    -1    lib/tools.cpp

https://invent.kde.org/plasma-mobile/qmlkonsole/-/commit/cd91b920ce1a274da1b3321a3be032f2a9673385

diff --git a/lib/tools.cpp b/lib/tools.cpp
index e651bd0..bc6ee46 100644
--- a/lib/tools.cpp
+++ b/lib/tools.cpp
@@ -36,5 +36,9 @@ But in some cases (apple bundle) there can be more locations).
 */
 const QStringList colorSchemesDirs()
 {
-    return {QStringLiteral(":/konsoleqml/color-schemes/")};
+    QStringList dirs = {QStringLiteral(":/konsoleqml/color-schemes/")};
+    dirs << QDir::homePath() + QStringLiteral("/.local/share/konsole");
+    dirs << QStringLiteral("/usr/share/konsole");
+    dirs << custom_color_schemes_dirs;
+    return dirs;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.