diff options
author | Mateusz Łukasik <mati75@linuxmint.pl> | 2016-04-08 10:03:05 +0200 |
---|---|---|
committer | Mateusz Łukasik <mati75@linuxmint.pl> | 2016-04-08 10:03:05 +0200 |
commit | 1a2f0c9c1087899a00298db8fa70518d3c1e69f8 (patch) | |
tree | 7efa117e122fbe21eb6a832540007aeeef377fcb /src/images.cpp | |
parent | ba0162e8cb8a12c90ef9775f5a20a6da095a0b35 (diff) |
Imported Upstream version 16.4.0~ds0
Diffstat (limited to 'src/images.cpp')
-rw-r--r-- | src/images.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/images.cpp b/src/images.cpp index b092dc0..a24506c 100644 --- a/src/images.cpp +++ b/src/images.cpp @@ -99,18 +99,22 @@ QString Images::file(const QString & name) { if (!current_theme.isEmpty()) { #ifdef USE_RESOURCES if (has_rcc) { - icon_name = ":/" + current_theme + "/"+ name + ".png"; + icon_name = ":/" + current_theme + "/"+ name; } else { - icon_name = themes_path +"/"+ current_theme + "/"+ name + ".png"; + icon_name = themes_path +"/"+ current_theme + "/"+ name; } #else - icon_name = themes_path +"/"+ current_theme + "/"+ name + ".png"; + icon_name = themes_path +"/"+ current_theme + "/"+ name; #endif } + bool has_extension = name.contains("."); + if (!has_extension) icon_name += ".png"; + //qDebug() << "Images::file:" << icon_name; if ((icon_name.isEmpty()) || (!QFile::exists(icon_name))) { - icon_name = ":/default-theme/" + name + ".png"; + icon_name = ":/default-theme/" + name; + if (!has_extension) icon_name += ".png"; } //qDebug() << "Images::file:" << icon_name; |