rem: QString host = KolabConfig::self()->server(); QString basedn = host; basedn.replace(".",",dc="); basedn.prepend("dc=");  KConfig c( "kabldaprc" ); c.setGroup( "LDAP" ); uint selHosts = c.readNumEntry("NumSelectedHosts", 0); c.writeEntry( "NumSelectedHosts", selHosts + 1 ); c.writeEntry( QString("SelectedHost%1").arg(selHosts), host); c.writeEntry( QString("SelectedBase%1").arg(selHosts), basedn); c.writeEntry( QString("SelectedPort%1").arg(selHosts), "389");
add: KRES::Manager<KABC::Resource> m( "contact" ); m.readConfig(); KABC::ResourceIMAP *r = new KABC::ResourceIMAP( 0 ); r->setResourceName( i18n("Kolab Server") ); m.add( r ); m.writeConfig();
context:     void apply()    {      QString host = KolabConfig::self()->server();      QString basedn = host;      basedn.replace(".",",dc=");      basedn.prepend("dc=");      KConfig c( "kabldaprc" );      c.setGroup( "LDAP" );      uint selHosts = c.readNumEntry("NumSelectedHosts", 0);      c.writeEntry( "NumSelectedHosts", selHosts + 1 );      c.writeEntry( QString("SelectedHost%1").arg(selHosts), host);      c.writeEntry( QString("SelectedBase%1").arg(selHosts), basedn);      c.writeEntry( QString("SelectedPort%1").arg(selHosts), "389");    }