From 8231cc23f3e8b266a6b0e229865905233e867cbf Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 7 Jul 2014 19:51:30 -0500 Subject: Fix korgac abort on startup due to oversized tray icon creation when icon widget has not yet been shown Properly print caldav/carddav wallet warnings to prevent backtrace spew --- korganizer/korgac/alarmdockwindow.cpp | 16 +++++++++++++--- korganizer/korgac/alarmdockwindow.h | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'korganizer') diff --git a/korganizer/korgac/alarmdockwindow.cpp b/korganizer/korgac/alarmdockwindow.cpp index f8f15addf..1f5d5b33c 100644 --- a/korganizer/korgac/alarmdockwindow.cpp +++ b/korganizer/korgac/alarmdockwindow.cpp @@ -58,8 +58,8 @@ AlarmDockWindow::AlarmDockWindow( const char *name ) // Set up icons TDEGlobal::iconLoader()->addAppDir( "korgac" ); - mPixmapEnabled = loadSizedIcon( "korgac", width() ); - mPixmapDisabled = loadSizedIcon( "korgac_disabled", width() ); + mPixmapEnabled = loadIcon( "korgac" ); + mPixmapDisabled = loadIcon( "korgac_disabled" ); setPixmap( alarmsEnabled ? mPixmapEnabled : mPixmapDisabled ); @@ -104,7 +104,7 @@ AlarmDockWindow::~AlarmDockWindow() { } -void AlarmDockWindow::resizeEvent ( TQResizeEvent * ) +void AlarmDockWindow::resizeTrayIcon () { // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes mPixmapEnabled = loadSizedIcon( "korgac", width() ); @@ -115,6 +115,16 @@ void AlarmDockWindow::resizeEvent ( TQResizeEvent * ) setPixmap( alarmsEnabled ? mPixmapEnabled : mPixmapDisabled ); } +void AlarmDockWindow::resizeEvent ( TQResizeEvent * ) +{ + resizeTrayIcon(); +} + +void AlarmDockWindow::showEvent ( TQShowEvent * ) +{ + resizeTrayIcon(); +} + void AlarmDockWindow::slotUpdate( int reminders ) { TQToolTip::remove( this ); diff --git a/korganizer/korgac/alarmdockwindow.h b/korganizer/korgac/alarmdockwindow.h index 6f317fda8..6f6cd7bdb 100644 --- a/korganizer/korgac/alarmdockwindow.h +++ b/korganizer/korgac/alarmdockwindow.h @@ -52,12 +52,16 @@ class AlarmDockWindow : public KSystemTray void mousePressEvent( TQMouseEvent * ); // void closeEvent( TQCloseEvent * ); void resizeEvent ( TQResizeEvent * ); + void showEvent ( TQShowEvent * ); protected slots: void slotQuit(); void slotSuspendAll(); void slotDismissAll(); + private: + void resizeTrayIcon(); + private: TQPixmap mPixmapEnabled; TQPixmap mPixmapDisabled; -- cgit v1.2.1