Bug 75204 - summary chart for birthdays not updated
Summary: summary chart for birthdays not updated
Status: RESOLVED FIXED
Alias: None
Product: kontact
Classification: Applications
Component: summary (show other bugs)
Version: 0.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-14 07:20 UTC by Amit Shah
Modified: 2004-02-20 20:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Shah 2004-02-14 07:20:55 UTC
Version:           0.1 (using KDE 3.2.0, compiled sources)
Compiler:          gcc version 3.3.3 20031229 (prerelease) (Debian)
OS:          Linux (i686) release 2.6.2

When kontact is left running overnight, the summary page for birthdays isn't updated. It still shows the birthdays for previous day marked "today".
Comment 1 Tobias Koenig 2004-02-20 20:34:58 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();
 }