Bug 118381

Summary: Mistake in reporting upcoming German Holidays on Overview page
Product: [Applications] kontact Reporter: Alexander Isphording <a.isphording>
Component: summaryAssignee: Allen Winter <winter>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alexander Isphording 2005-12-15 15:21:19 UTC
Version:           1.1 (using KDE 3.4.2 Level "b" , SUSE 10.0)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.7-default

On the Overview page of the German language version of Kontact an upcoming holiday (in this case Advent 4th) is displayed as being in three days, namely on Sunday the 18th of December. This is correct. However, after using Kontace for a while, this always changes to "Advent 3rd coming up in two days on Saturday, Dec 17." In the calendar it is still displayed on the correct day, Sunday.
Comment 1 Allen Winter 2005-12-15 22:03:26 UTC
SVN commit 488768 by winterz:

Fix for holidays going whacky.  Apparently, the libkholidays stuff
isn't re-entrant.  In any event, one day (far, far away) we will
rewrite libkholidays and it will be wonderful.

So watch for KDE 3.5.1 to get this fix.

BUGS: 118381, 117545


 M  +12 -16    sdsummarywidget.cpp  
 M  +0 -1      sdsummarywidget.h  


--- branches/KDE/3.5/kdepim/kontact/plugins/specialdates/sdsummarywidget.cpp #488767:488768
@@ -79,7 +79,7 @@
 
 SDSummaryWidget::SDSummaryWidget( Kontact::Plugin *plugin, QWidget *parent,
                                     const char *name )
-  : Kontact::Summary( parent, name ), mPlugin( plugin ), mCalendar( 0 )
+  : Kontact::Summary( parent, name ), mPlugin( plugin ), mCalendar( 0 ), mHolidays( 0 )
 {
   // Create the Summary Layout
   QVBoxLayout *mainLayout = new QVBoxLayout( this, 3, 3 );
@@ -87,7 +87,7 @@
   QPixmap icon = KGlobal::iconLoader()->loadIcon( "cookie",
                     KIcon::Desktop, KIcon::SizeMedium );
 
-  QWidget *header = createHeader( this, icon, i18n( "Special Dates" ) );
+  QWidget *header = createHeader( this, icon, i18n( "Upcoming Special Dates" ) );
   mainLayout->addWidget(header);
 
   mLayout = new QGridLayout( mainLayout, 7, 6, 3 );
@@ -145,22 +145,22 @@
   config.setGroup( "Days" );
   mDaysAhead = config.readNumEntry( "DaysToShow", 7 );
 
-  config.setGroup( "EventTypes" );
+  config.setGroup( "Show" );
   mShowBirthdaysFromKAB =
-    config.readBoolEntry( "ShowBirthdaysFromContacts", true );
+    config.readBoolEntry( "BirthdaysFromContacts", true );
   mShowBirthdaysFromCal =
-    config.readBoolEntry( "ShowBirthdaysFromCalendar", true );
+    config.readBoolEntry( "BirthdaysFromCalendar", true );
 
   mShowAnniversariesFromKAB =
-    config.readBoolEntry( "ShowAnniversariesFromContacts", true );
+    config.readBoolEntry( "AnniversariesFromContacts", true );
   mShowAnniversariesFromCal =
-    config.readBoolEntry( "ShowAnniversariesFromCalendar", true );
+    config.readBoolEntry( "AnniversariesFromCalendar", true );
 
   mShowHolidays =
-    config.readBoolEntry( "ShowHolidays", true );
+    config.readBoolEntry( "HolidaysFromCalendar", true );
 
   mShowSpecialsFromCal =
-    config.readBoolEntry( "ShowSpecialsFromCalendar", true );
+    config.readBoolEntry( "SpecialsFromCalendar", true );
 
   updateView();
 }
@@ -170,13 +170,9 @@
   KConfig hconfig( "korganizerrc" );
   hconfig.setGroup( "Time & Date" );
   QString location = hconfig.readEntry( "Holidays" );
-  if ( !location.isNull() ) {
-    if ( location != mLastLocation ) {
-      if ( !mLastLocation.isNull() && !mLastLocation.isEmpty() )
-        delete mHolidays;
-      mLastLocation = location;
-      mHolidays = new KHolidays::KHolidays( location );
-    }
+  if ( !location.isEmpty() ) {
+    if ( mHolidays ) delete mHolidays;
+    mHolidays = new KHolidays( location );
     return true;
   }
   return false;
--- branches/KDE/3.5/kdepim/kontact/plugins/specialdates/sdsummarywidget.h #488767:488768
@@ -78,7 +78,6 @@
     bool mShowHolidays;
     bool mShowSpecialsFromCal;
 
-    QString mLastLocation;
     KHolidays::KHolidays *mHolidays;
 };
 
Comment 2 Mathias Homann 2005-12-15 22:05:43 UTC
so, when's kde 3.5.1 due? there are loads of other bugs, especially in kontact summary, that already had been fixed once during the kde 3.4.x cycle...
like, refreshing of mail summary and such...