Index: konsolekalendar/main.cpp =================================================================== RCS file: /home/kde/kdepim/konsolekalendar/main.cpp,v retrieving revision 1.48 diff -p -u -b -r1.48 main.cpp --- konsolekalendar/main.cpp 26 Nov 2003 09:21:50 -0000 1.48 +++ konsolekalendar/main.cpp 27 Nov 2003 14:33:07 -0000 @@ -494,6 +494,8 @@ int main(int argc, char *argv[]) variables.setCalendar( localCalendar ); } else { calendarResource = new CalendarResources(); + calendarResource->readConfig(); + calendarResource->load(); variables.setCalendarResources( calendarResource ); } Index: korganizer/kocore.cpp =================================================================== RCS file: /home/kde/kdepim/korganizer/kocore.cpp,v retrieving revision 1.29 diff -p -u -b -r1.29 kocore.cpp --- korganizer/kocore.cpp 25 Nov 2003 21:35:39 -0000 1.29 +++ korganizer/kocore.cpp 27 Nov 2003 14:33:08 -0000 @@ -311,6 +311,8 @@ KCal::CalendarResources *KOCore::calenda { if ( !mCalendarResources ) { mCalendarResources = new KCal::CalendarResources( KOPrefs::instance()->mTimeZoneId ); + mCalendarResources->readConfig(); + mCalendarResources->load(); KCal::CalendarResourceManager *manager = mCalendarResources->resourceManager(); Index: korganizer/korgac/koalarmclient.cpp =================================================================== RCS file: /home/kde/kdepim/korganizer/korgac/koalarmclient.cpp,v retrieving revision 1.15 diff -p -u -b -r1.15 koalarmclient.cpp --- korganizer/korgac/koalarmclient.cpp 16 Nov 2003 19:28:40 -0000 1.15 +++ korganizer/korgac/koalarmclient.cpp 27 Nov 2003 14:33:08 -0000 @@ -53,6 +53,8 @@ KOAlarmClient::KOAlarmClient( QObject *p SLOT( suspend( int ) ) ); mCalendar = new CalendarResources(); + mCalendar->readConfig(); + mCalendar->load(); KConfig c( locate( "config", "korganizerrc" ) ); c.setGroup( "Time & Date" ); Index: kpilot/conduits/vcalconduit/vcal-conduitbase.cc =================================================================== RCS file: /home/kde/kdepim/kpilot/conduits/vcalconduit/vcal-conduitbase.cc,v retrieving revision 1.48 diff -p -u -b -r1.48 vcal-conduitbase.cc --- kpilot/conduits/vcalconduit/vcal-conduitbase.cc 19 Oct 2003 20:38:58 -0000 1.48 +++ kpilot/conduits/vcalconduit/vcal-conduitbase.cc 27 Nov 2003 14:33:10 -0000 @@ -318,6 +318,8 @@ error: "object for ResourceCalendar"<readConfig(); + fCalendar->load(); break; default: break; Index: libkcal/calendarresources.cpp =================================================================== RCS file: /home/kde/kdepim/libkcal/calendarresources.cpp,v retrieving revision 1.35 diff -p -u -b -r1.35 calendarresources.cpp --- libkcal/calendarresources.cpp 9 Nov 2003 23:23:26 -0000 1.35 +++ libkcal/calendarresources.cpp 27 Nov 2003 14:33:11 -0000 @@ -85,9 +85,29 @@ void CalendarResources::init() kdDebug(5800) << "CalendarResources::init" << endl; mManager = new CalendarResourceManager( "calendar" ); - mManager->readConfig( 0 ); mManager->addObserver( this ); + mStandardPolicy = new StandardDestinationPolicy( mManager ); + mAskPolicy = new AskDestinationPolicy( mManager ); + mDestinationPolicy = mStandardPolicy; +} + +CalendarResources::~CalendarResources() +{ + kdDebug(5800) << "CalendarResources::destructor" << endl; + + close(); + + delete mManager; +} + +void CalendarResources::readConfig( KConfig *config ) +{ + mManager->readConfig( config ); +} + +void CalendarResources::load() +{ if ( !mManager->standardResource() ) { kdDebug(5800) << "Warning! No standard resource yet." << endl; } @@ -108,23 +128,9 @@ void CalendarResources::init() connectResource( *it ); } - mStandardPolicy = new StandardDestinationPolicy( mManager ); - mAskPolicy = new AskDestinationPolicy( mManager ); - mDestinationPolicy = mStandardPolicy; - mOpen = true; } - -CalendarResources::~CalendarResources() -{ - kdDebug(5800) << "CalendarResources::destructor" << endl; - - close(); - - delete mManager; -} - void CalendarResources::setStandardDestinationPolicy() { mDestinationPolicy = mStandardPolicy; Index: libkcal/calendarresources.h =================================================================== RCS file: /home/kde/kdepim/libkcal/calendarresources.h,v retrieving revision 1.26 diff -p -u -b -r1.26 calendarresources.h --- libkcal/calendarresources.h 9 Nov 2003 23:23:26 -0000 1.26 +++ libkcal/calendarresources.h 27 Nov 2003 14:33:11 -0000 @@ -99,6 +99,22 @@ class CalendarResources : public Calenda ~CalendarResources(); /** + Read the resources settings from a config file. You have to call this + method before load(). + + @param config The KConfig object which points to the config file. + If no object is given (null pointer) the standard config + file is used. + */ + void readConfig( KConfig *config = 0 ); + + /** + Loads all events from the resources. You have to add the resources first + or call readConfig() to load the system resources. + */ + void load(); + + /** Return ResourceManager used by this calendar. */ CalendarResourceManager *resourceManager() const