[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] PATCH: Show holidays on correct days
From:       Cornelius Schumacher <schumacher () kde ! org>
Date:       2002-12-26 0:52:27
[Download RAW message or body]

The attached patch fixes bug #51721. If there are no objections I will 
apply it to the 3.1 branch.

-- 
Cornelius Schumacher <schumacher@kde.org>
["advent.diff" (text/x-diff)]

Index: kocore.cpp
===================================================================
RCS file: /home/kde/kdepim/korganizer/kocore.cpp,v
retrieving revision 1.13
diff -u -3 -d -p -r1.13 kocore.cpp
--- kocore.cpp	18 Nov 2002 10:21:29 -0000	1.13
+++ kocore.cpp	25 Dec 2002 23:53:27 -0000
@@ -46,8 +46,7 @@ KOCore *KOCore::self()
 }
 
 KOCore::KOCore() :
-  mCalendarDecorationsLoaded(false),
-  mHolidaysLoaded(false)
+  mCalendarDecorationsLoaded(false)
 {
   KGlobal::config()->setGroup("General");
   QString calSystem = KGlobal::config()->readEntry( "CalendarSystem", "gregorian" );
@@ -178,8 +177,11 @@ KOrg::CalendarDecoration::List KOCore::c
     KTrader::OfferList::ConstIterator it;
     for(it = plugins.begin(); it != plugins.end(); ++it) {
       if ((*it)->hasServiceType("Calendar/Decoration")) {
-        if (selectedPlugins.find((*it)->desktopEntryName()) != selectedPlugins.end()) {
-          mCalendarDecorations.append(loadCalendarDecoration(*it));
+        QString name = (*it)->desktopEntryName();
+        if ( selectedPlugins.find( name ) != selectedPlugins.end() ) {
+          KOrg::CalendarDecoration *d = loadCalendarDecoration(*it);
+          mCalendarDecorations.append( d );
+          if ( name == "holidays" ) mHolidays = d;
         }
       }
     }
@@ -245,11 +247,7 @@ void KOCore::reloadPlugins()
 
 QString KOCore::holiday(const QDate &date)
 {
-  if (!mHolidaysLoaded) {
-    mHolidays = static_cast<KOrg::CalendarDecoration *>(loadPlugin("holidays"));
-    mHolidaysLoaded = true;
-  }
-  
+  calendarDecorations();
   if (mHolidays)
     return mHolidays->shortText(date);
   else
Index: kocore.h
===================================================================
RCS file: /home/kde/kdepim/korganizer/kocore.h,v
retrieving revision 1.11
diff -u -3 -d -p -r1.11 kocore.h
--- kocore.h	22 Sep 2002 22:49:19 -0000	1.11
+++ kocore.h	25 Dec 2002 23:53:27 -0000
@@ -78,7 +78,6 @@ class KOCore {
     bool mCalendarDecorationsLoaded;
     
     KOrg::CalendarDecoration *mHolidays;
-    bool mHolidaysLoaded;    
 
     KCalendarSystem *mCalendarSystem;
 };

_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic