diff options
author | Mateusz Łukasik <mati75@linuxmint.pl> | 2017-05-28 22:58:38 +0200 |
---|---|---|
committer | Mateusz Łukasik <mati75@linuxmint.pl> | 2017-05-28 22:58:38 +0200 |
commit | 8cd3e30b34e5ff62a993227c386ab77dd01fa1d4 (patch) | |
tree | 60ab5ccc720108feb6a82ad91c0d212f52e32a3b /src/images.cpp | |
parent | 8fa0adcb32570bfa1f7e6a3b0411b6d789fda623 (diff) |
New upstream version 17.5.0~ds0
Diffstat (limited to 'src/images.cpp')
-rw-r--r-- | src/images.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/images.cpp b/src/images.cpp index e1a1923..11b1a53 100644 --- a/src/images.cpp +++ b/src/images.cpp @@ -34,6 +34,8 @@ using namespace Global; QString Images::current_theme; QString Images::themes_path; +bool Images::is_internal = false; + #ifdef USE_RESOURCES QString Images::last_resource_loaded; bool Images::has_rcc = false; @@ -54,6 +56,16 @@ QString Images::resourceFilename() { void Images::setTheme(const QString & name) { current_theme = name; + is_internal = (QFile::exists(":/" + current_theme + "/style.qss")); + if (is_internal) { + qDebug() << "Images::setTheme:" << current_theme << "is an internal theme"; + setThemesPath(""); + #ifdef USE_RESOURCES + has_rcc = false; + #endif + return; + } + #ifdef SMCODE QString dir = Paths::configPath() + "/themes/" + name; if (QFile::exists(dir)) { @@ -98,13 +110,17 @@ QString Images::file(const QString & name) { QString icon_name; if (!current_theme.isEmpty()) { #ifdef USE_RESOURCES - if (has_rcc) { + if (has_rcc || is_internal) { icon_name = ":/" + current_theme + "/"+ name; } else { icon_name = themes_path +"/"+ current_theme + "/"+ name; } #else - icon_name = themes_path +"/"+ current_theme + "/"+ name; + if (is_internal) { + icon_name = ":/" + current_theme + "/"+ name; + } else { + icon_name = themes_path +"/"+ current_theme + "/"+ name; + } #endif } |