[plasma-mobile/qmlkonsole] lib: Search external directories for custom color schemes
Devin Lin <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 9361861489cf9247c49ec093e0bafcf8f6b23ce0 by Devin Lin, on behalf of Perry Gibson.
Committed on 18/07/2026 at 17:43.
Pushed by devinlin into branch 'master'.
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/9361861489cf9247c49ec093e0bafcf8f6b23ce0
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;
}