diff options
author | Timothy Pearson <[email protected]> | 2014-07-07 11:03:44 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2014-07-07 11:03:44 -0500 |
commit | d69942a00955a9361e3704de40d6aad8bf8633b9 (patch) | |
tree | 6ed63b5a0e37de91fb1e9e299d2d85cb21165cee | |
parent | 97bb544fa355be9abd4ebf5bab3f02fd3f820695 (diff) | |
download | adept-d69942a00955a9361e3704de40d6aad8bf8633b9.tar.gz adept-d69942a00955a9361e3704de40d6aad8bf8633b9.zip |
Fix abort on startup due to oversized tray icon creation when icon widget has not yet been shown
-rw-r--r-- | adept/notifier/app.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/adept/notifier/app.cpp b/adept/notifier/app.cpp index 7fe637d..3abcfd2 100644 --- a/adept/notifier/app.cpp +++ b/adept/notifier/app.cpp @@ -68,14 +68,16 @@ void TrayWindow::setAvailableUpdates( int n ) m_updates = n; kdDebug() << "TrayWindow obtained " << n << endl; - setPixmap( m_updates == 0 ? - loadSizedIcon( u8( "adept_notifier_ok" ), width() ) : - loadSizedIcon( u8( "adept_notifier_warning" ), width() ) ); - - if ( m_updates == 0 ) + if ( m_updates == 0 ) { + if (isShown()) { + loadSizedIcon( u8( "adept_notifier_ok" ), width() ); + } hide(); - else + } + else { show(); + loadSizedIcon( u8( "adept_notifier_warning" ), width() ); + } TQToolTip::remove(this); TQToolTip::add(this, n == 0 ? i18n( "No updates needed." ) @@ -90,7 +92,7 @@ void TrayWindow::mouseReleaseEvent(TQMouseEvent *ev) KSystemTray::mouseReleaseEvent(ev); } -void ApportTrayWindow::mousePressEvent(TQMouseEvent *ev) +void ApportTrayWindow::mousePressEvent(TQMouseEvent * ) { emit clicked(); hide(); @@ -102,7 +104,7 @@ void ApportTrayWindow::resizeEvent ( TQResizeEvent * ) setPixmap( loadSizedIcon(u8("apport"), width()) ); } -void RebootTrayWindow::mousePressEvent(TQMouseEvent *ev) +void RebootTrayWindow::mousePressEvent(TQMouseEvent * ) { emit clicked(); } |