diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-07-08 08:36:34 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-07-08 08:36:34 -0500 |
commit | bba29e95ab1eaf3099c44b1672fa4996bf24095d (patch) | |
tree | 43a91b107a6e47d693594bc318a7f63340942e6e /src/knemod/interfaceicon.cpp | |
parent | 81bdfc2374e86c889d532c0035c103f8a6a2b842 (diff) | |
download | knemo-bba29e95ab1eaf3099c44b1672fa4996bf24095d.tar.gz knemo-bba29e95ab1eaf3099c44b1672fa4996bf24095d.zip |
Fix abort on startup due to oversized tray icon creation when icon widget has not yet been shown
Diffstat (limited to 'src/knemod/interfaceicon.cpp')
-rw-r--r-- | src/knemod/interfaceicon.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/knemod/interfaceicon.cpp b/src/knemod/interfaceicon.cpp index 7b99041..cebcbc2 100644 --- a/src/knemod/interfaceicon.cpp +++ b/src/knemod/interfaceicon.cpp @@ -88,24 +88,24 @@ void InterfaceIcon::updateStatus( int status ) if ( status == Interface::NOT_AVAILABLE || status == Interface::NOT_EXISTING ) { - mTray->setPixmap( mTray->loadSizedIcon( ICON_DISCONNECTED + suffix, mTray->width() ) ); + mTray->setPixmap( mTray->isShown() ? mTray->loadSizedIcon( ICON_DISCONNECTED + suffix, mTray->width() ) : mTray->loadIcon( ICON_DISCONNECTED + suffix ) ); } else if ( ( status & Interface::RX_TRAFFIC ) && ( status & Interface::TX_TRAFFIC ) ) { - mTray->setPixmap( mTray->loadSizedIcon( ICON_TRAFFIC + suffix, mTray->width() ) ); + mTray->setPixmap( mTray->isShown() ? mTray->loadSizedIcon( ICON_TRAFFIC + suffix, mTray->width() ) : mTray->loadIcon( ICON_TRAFFIC + suffix ) ); } else if ( status & Interface::RX_TRAFFIC ) { - mTray->setPixmap( mTray->loadSizedIcon( ICON_INCOMING + suffix, mTray->width() ) ); + mTray->setPixmap( mTray->isShown() ? mTray->loadSizedIcon( ICON_INCOMING + suffix, mTray->width() ) : mTray->loadIcon( ICON_INCOMING + suffix ) ); } else if ( status & Interface::TX_TRAFFIC ) { - mTray->setPixmap( mTray->loadSizedIcon( ICON_OUTGOING + suffix, mTray->width() ) ); + mTray->setPixmap( mTray->isShown() ? mTray->loadSizedIcon( ICON_OUTGOING + suffix, mTray->width() ) : mTray->loadIcon( ICON_OUTGOING + suffix ) ); } else { - mTray->setPixmap( mTray->loadSizedIcon( ICON_CONNECTED + suffix, mTray->width() ) ); + mTray->setPixmap( mTray->isShown() ? mTray->loadSizedIcon( ICON_CONNECTED + suffix, mTray->width() ) : mTray->loadIcon( ICON_CONNECTED + suffix ) ); } } |