Summary: | summary chart for birthdays not updated | ||
---|---|---|---|
Product: | [Applications] kontact | Reporter: | Amit Shah <amitshah> |
Component: | summary | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 0.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Amit Shah
2004-02-14 07:20:55 UTC
CVS commit by tokoe: Connect the dayChanged() signal with the update methods of the addressbook, appointment and todo views. CCMAIL:75204-done@bugs.kde.org M +11 -6 kaddressbook/kabsummarywidget.cpp 1.31 M +11 -2 korganizer/summarywidget.cpp 1.12 M +1 -0 korganizer/summarywidget.h 1.7 M +4 -1 korganizer/todosummarywidget.cpp 1.4 --- kdepim/kontact/plugins/kaddressbook/kabsummarywidget.cpp #1.30:1.31 @@ -77,4 +77,7 @@ KABSummaryWidget::KABSummaryWidget( Kont this, SLOT( updateView() ) ); + connect( mPlugin->core(), SIGNAL( dayChanged( const QDate& ) ), + this, SLOT( updateView() ) ); + mDaysAhead = 62; // ### make configurable @@ -90,4 +93,5 @@ void KABSummaryWidget::updateView() KABC::StdAddressBook *ab = KABC::StdAddressBook::self(); QValueList<KABDateEntry> dates; + QLabel *label = 0; KABC::AddressBook::Iterator it; @@ -129,5 +133,5 @@ void KABSummaryWidget::updateView() bool makeBold = (*addrIt).daysTo < 5; - QLabel *label = new QLabel( this ); + label = new QLabel( this ); if ( (*addrIt).birthday ) label->setPixmap( KGlobal::iconLoader()->loadIcon( "cookie", KIcon::Small ) ); @@ -184,14 +188,15 @@ void KABSummaryWidget::updateView() } } else { - QLabel *nothingtosee = new QLabel( + label = new QLabel( i18n( "No birthdays or anniversaries pending within the next 1 day", "No birthdays or anniversaries pending within the next %n days", mDaysAhead ), this, "nothing to see" ); - nothingtosee->setAlignment( AlignCenter ); - nothingtosee->setTextFormat( RichText ); - mLayout->addMultiCellWidget( nothingtosee, 0, 0, 0, 4 ); + label->setAlignment( AlignCenter ); + label->setTextFormat( RichText ); + mLayout->addMultiCellWidget( label, 0, 0, 0, 4 ); } - show(); + for ( label = mLabels.first(); label; label = mLabels.next() ) + label->show(); } --- kdepim/kontact/plugins/korganizer/summarywidget.cpp #1.11:1.12 @@ -44,5 +44,5 @@ SummaryWidget::SummaryWidget( KOrganizerPlugin *plugin, QWidget *parent, const char *name ) - : Kontact::Summary( parent, name ), mPlugin( plugin ) + : Kontact::Summary( parent, name ), mPlugin( plugin ), mCalendar( 0 ) { QVBoxLayout *mainLayout = new QVBoxLayout( this, 3, 3 ); @@ -84,8 +84,16 @@ SummaryWidget::SummaryWidget( KOrganizer connect( mCalendar, SIGNAL( calendarChanged() ), SLOT( updateView() ) ); + connect( mPlugin->core(), SIGNAL( dayChanged( const QDate& ) ), + SLOT( updateView() ) ); updateView(); } +SummaryWidget::~SummaryWidget() +{ + delete mCalendar; + mCalendar = 0; +} + void SummaryWidget::updateView() { @@ -166,5 +174,6 @@ void SummaryWidget::updateView() } - show(); + for ( label = mLabels.first(); label; label = mLabels.next() ) + label->show(); } --- kdepim/kontact/plugins/korganizer/summarywidget.h #1.6:1.7 @@ -44,4 +44,5 @@ class SummaryWidget : public Kontact::Su SummaryWidget( KOrganizerPlugin *plugin, QWidget *parent, const char *name = 0 ); + ~SummaryWidget(); int summaryHeight() const { return 3; } --- kdepim/kontact/plugins/korganizer/todosummarywidget.cpp #1.3:1.4 @@ -85,4 +85,6 @@ TodoSummaryWidget::TodoSummaryWidget( To connect( mCalendar, SIGNAL( calendarChanged() ), SLOT( updateView() ) ); + connect( mPlugin->core(), SIGNAL( dayChanged( const QDate& ) ), + SLOT( updateView() ) ); updateView(); @@ -143,5 +145,6 @@ void TodoSummaryWidget::updateView() } - show(); + for ( label = mLabels.first(); label; label = mLabels.next() ) + label->show(); } |