Browse Source

Fix abort on startup due to oversized tray icon creation when icon widget has not yet been shown

tags/r14.0.0
Timothy Pearson 5 years ago
parent
commit
5997a6378c
2 changed files with 9 additions and 6 deletions
  1. 2
    2
      .gitmodules
  2. 7
    4
      src/kpowersave.cpp

+ 2
- 2
.gitmodules View File

@@ -1,6 +1,6 @@
[submodule "admin"]
path = admin
url = http://system@scm.trinitydesktop.org/scm/git/tde-common-admin
url = http://scm.trinitydesktop.org/scm/git/tde-common-admin
[submodule "cmake"]
path = cmake
url = http://system@scm.trinitydesktop.org/scm/git/tde-common-cmake
url = http://scm.trinitydesktop.org/scm/git/tde-common-cmake

+ 7
- 4
src/kpowersave.cpp View File

@@ -361,10 +361,11 @@ void kpowersave::loadIcon(bool forceReload){
if ((pixmap_name_tmp != pixmap_name) || (forceReload)) {
pixmap_name = pixmap_name_tmp;
if (pixmap_name.startsWith("ERROR")) {
pixmap = SmallIcon("laptoppower", width(), TDEIcon::DisabledState);
pixmap = SmallIcon("laptoppower", isShown() ? width() : 22, TDEIcon::DisabledState);
}
else {
pixmap = SmallIcon(pixmap_name, isShown() ? width() : 22);
}
else
pixmap = SmallIcon(pixmap_name, width());
}

kdDebugFuncOut(trace);
@@ -435,7 +436,9 @@ void kpowersave::drawIcon(){
}
}
quit:
image = image.smoothScale(width(), height());
if (isShown()) {
image = image.smoothScale(width(), height());
}
fullIcon.convertFromImage(image);
setPixmap(fullIcon);


Loading…
Cancel
Save