Bug 117545 - Summary for "special dates" shows wrong time spans
Summary: Summary for "special dates" shows wrong time spans
Status: RESOLVED FIXED
Alias: None
Product: kontact
Classification: Applications
Component: summary (show other bugs)
Version: 1.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Allen Winter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-02 23:19 UTC by Eckhart Wörner
Modified: 2005-12-15 22:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eckhart Wörner 2005-12-02 23:19:47 UTC
Version:           1.1 (using KDE 3.5.0, Kubuntu Package 4:3.5.0-0ubuntu0breezy1 breezy)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.12-9-386

When Kontact starts with summary component (my default), special dates summary correctly shows me the "second advent" as "in two days". When I switch to calendar or tasks module and then switch back to summary, it shows me that the second advent is "tomorrow". This remains until I restart Kontact.

[Time & Date]
Holidays=de
TimeZoneId=Europe/Berlin
Comment 1 Thorsten Staerk 2005-12-02 23:32:52 UTC
You have a system with and one without that bug.
Can you paste the buggy and non-buggy version of korganizerrc ? Or paste a diff ?
Comment 2 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;
 };