summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2014-07-08 09:18:14 -0500
committerTimothy Pearson <[email protected]>2014-07-08 09:18:14 -0500
commit5997a6378cdae679e018b1c29014d9e52c5e8631 (patch)
tree5c4ab1a41e143b39f0b7dc668c220d95e9f6d58e
parentdcd19cee1d789ddb3a6d83487b4b53268e0aaa34 (diff)
downloadkpowersave-5997a6378cdae679e018b1c29014d9e52c5e8631.tar.gz
kpowersave-5997a6378cdae679e018b1c29014d9e52c5e8631.zip
Fix abort on startup due to oversized tray icon creation when icon widget has not yet been shown
-rw-r--r--.gitmodules4
-rw-r--r--src/kpowersave.cpp11
2 files changed, 9 insertions, 6 deletions
diff --git a/.gitmodules b/.gitmodules
index 4fce771..5a9a136 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "admin"]
path = admin
- url = http://[email protected]/scm/git/tde-common-admin
+ url = http://scm.trinitydesktop.org/scm/git/tde-common-admin
[submodule "cmake"]
path = cmake
- url = http://[email protected]/scm/git/tde-common-cmake
+ url = http://scm.trinitydesktop.org/scm/git/tde-common-cmake
diff --git a/src/kpowersave.cpp b/src/kpowersave.cpp
index d6d98c2..b372245 100644
--- a/src/kpowersave.cpp
+++ b/src/kpowersave.cpp
@@ -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);