rem: KCal::ResourceGroupwise *r = new KCal::ResourceGroupwise();  r->setResourceName( i18n("GroupWise") ); r->prefs()->setUrl( serverUrl() ); r->prefs()->setUser( GroupwiseConfig::self()->user() ); r->prefs()->setPassword( GroupwiseConfig::self()->password() ); r->setSavePolicy( KCal::ResourceCached::SaveDelayed ); r->setReloadPolicy( KCal::ResourceCached::ReloadInterval ); r->setReloadInterval( 20 ); m.add( r );
add: KCal::CalendarResourceManager::Iterator it; for ( it = m.begin(); it != m.end(); ++it ) { if ( (*it)->identifier() == GroupwiseConfig::kcalResource() ) { KCal::ResourceGroupwise *r = static_cast<KCal::ResourceGroupwise *>( *it ); r->prefs()->setUrl( serverUrl() ); r->prefs()->setUser( GroupwiseConfig::self()->user() ); r->prefs()->setPassword( GroupwiseConfig::self()->password() ); r->setSavePolicy( KCal::ResourceCached::SaveDelayed ); r->setReloadPolicy( KCal::ResourceCached::ReloadInterval ); r->setReloadInterval( 20 ); } }
context:     void apply()    {      KCal::CalendarResourceManager m( "calendar" );      m.readConfig();      KCal::ResourceGroupwise *r = new KCal::ResourceGroupwise();      r->setResourceName( i18n("GroupWise") );      r->prefs()->setUrl( serverUrl() );      r->prefs()->setUser( GroupwiseConfig::self()->user() );      r->prefs()->setPassword( GroupwiseConfig::self()->password() );      r->setSavePolicy( KCal::ResourceCached::SaveDelayed );      r->setReloadPolicy( KCal::ResourceCached::ReloadInterval );      r->setReloadInterval( 20 );      m.add( r );      m.writeConfig();      GroupwiseConfig::self()->setKcalResource( r->identifier() );    }