author | ulf69 <ulf69> | 2004-07-27 00:57:35 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-27 00:57:35 (UTC) |
commit | 203a3f0cf7bfc16be93d3a9c75d244d5a9956c2c (patch) (side-by-side diff) | |
tree | 3d25d89a5a0206fd5abd0820be834949663daacf /microkde | |
parent | b33c195abfc2e83cc3510707f05bf6a4c93912cf (diff) | |
download | kdepimpi-203a3f0cf7bfc16be93d3a9c75d244d5a9956c2c.zip kdepimpi-203a3f0cf7bfc16be93d3a9c75d244d5a9956c2c.tar.gz kdepimpi-203a3f0cf7bfc16be93d3a9c75d244d5a9956c2c.tar.bz2 |
added sync-contact as new resourcefamily. Those resources can be choosen
as sync targets.
-rw-r--r-- | microkde/kresources/configpage.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp index 0f1469d..8782ffd 100644 --- a/microkde/kresources/configpage.cpp +++ b/microkde/kresources/configpage.cpp @@ -150,60 +150,63 @@ ConfigPage::~ConfigPage() mConfig = 0; } void ConfigPage::load() { kdDebug(5650) << "ConfigPage::load()" << endl; mListView->clear(); //US we remove the dynamic pluginloader, and set the one family we need (contact) manually. //US KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin" ); //US KTrader::OfferList::ConstIterator it; //US for ( it = plugins.begin(); it != plugins.end(); ++it ) { //US QVariant tmp = (*it)->property( "X-KDE-ResourceFamily" ); //US QString family = tmp.toString(); - - QString family = "contact"; + QStringList families; + families << "contact" << "sync-contacts"; + for ( QStringList::Iterator it = families.begin(); it != families.end(); ++it ) + { + QString family = (*it); if ( !family.isEmpty() ) { if ( !mFamilyMap.contains( family ) ) { mCurrentManager = new Manager<Resource>( family ); if ( mCurrentManager ) { mFamilyMap.append( family ); mCurrentManager->addListener( this ); ResourcePageInfo info; info.mManager = mCurrentManager; QString configDir = KGlobal::dirs()->saveLocation( "config" ); //QString configDir = KStandardDirs::appDir() + "/config"; if ( family == "contact" && QFile::exists( configDir + "/kabcrc" ) ) { info.mConfig = new KConfig( locateLocal( "config", "kabcrc" ) ); } else if ( family == "calendar" && QFile::exists( configDir + "/kcalrc" ) ) { info.mConfig = new KConfig( locateLocal( "config", "kcalrc" ) ); } else { QString configFile = locateLocal( "config", QString( "kresources/%1/stdrc" ).arg( family ) ); info.mConfig = new KConfig( configFile ); } info.mManager->readConfig( info.mConfig ); mInfoMap.append( info ); } } } -//US } + } mCurrentManager = 0; mFamilyCombo->insertStringList( mFamilyMap ); int currentFamily = mConfig->readNumEntry( "CurrentFamily", 0 ); mFamilyCombo->setCurrentItem( currentFamily ); slotFamilyChanged( currentFamily ); } void ConfigPage::save() { saveResourceSettings(); QValueList<ResourcePageInfo>::Iterator it; for ( it = mInfoMap.begin(); it != mInfoMap.end(); ++it ) (*it).mManager->writeConfig( (*it).mConfig ); |