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

master
Timothy Pearson 11 years ago
parent 97bb544fa3
commit d69942a009

@ -68,14 +68,16 @@ void TrayWindow::setAvailableUpdates( int n )
m_updates = n; m_updates = n;
kdDebug() << "TrayWindow obtained " << n << endl; kdDebug() << "TrayWindow obtained " << n << endl;
setPixmap( m_updates == 0 ? if ( m_updates == 0 ) {
loadSizedIcon( u8( "adept_notifier_ok" ), width() ) : if (isShown()) {
loadSizedIcon( u8( "adept_notifier_warning" ), width() ) ); loadSizedIcon( u8( "adept_notifier_ok" ), width() );
}
if ( m_updates == 0 )
hide(); hide();
else }
else {
show(); show();
loadSizedIcon( u8( "adept_notifier_warning" ), width() );
}
TQToolTip::remove(this); TQToolTip::remove(this);
TQToolTip::add(this, n == 0 ? i18n( "No updates needed." ) TQToolTip::add(this, n == 0 ? i18n( "No updates needed." )
@ -90,7 +92,7 @@ void TrayWindow::mouseReleaseEvent(TQMouseEvent *ev)
KSystemTray::mouseReleaseEvent(ev); KSystemTray::mouseReleaseEvent(ev);
} }
void ApportTrayWindow::mousePressEvent(TQMouseEvent *ev) void ApportTrayWindow::mousePressEvent(TQMouseEvent * )
{ {
emit clicked(); emit clicked();
hide(); hide();
@ -102,7 +104,7 @@ void ApportTrayWindow::resizeEvent ( TQResizeEvent * )
setPixmap( loadSizedIcon(u8("apport"), width()) ); setPixmap( loadSizedIcon(u8("apport"), width()) );
} }
void RebootTrayWindow::mousePressEvent(TQMouseEvent *ev) void RebootTrayWindow::mousePressEvent(TQMouseEvent * )
{ {
emit clicked(); emit clicked();
} }

Loading…
Cancel
Save