From d69942a00955a9361e3704de40d6aad8bf8633b9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 7 Jul 2014 11:03:44 -0500 Subject: [PATCH] Fix abort on startup due to oversized tray icon creation when icon widget has not yet been shown --- adept/notifier/app.cpp | 18 ++++++++++-------- 1 file 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(); }