summaryrefslogtreecommitdiffabout
path: root/microkde
Unidiff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/configpage.cpp9
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
@@ -154,26 +154,29 @@ void ConfigPage::load()
154{ 154{
155 kdDebug(5650) << "ConfigPage::load()" << endl; 155 kdDebug(5650) << "ConfigPage::load()" << endl;
156 156
157 mListView->clear(); 157 mListView->clear();
158 158
159//US we remove the dynamic pluginloader, and set the one family we need (contact) manually. 159//US we remove the dynamic pluginloader, and set the one family we need (contact) manually.
160 160
161//US KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin" ); 161//US KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin" );
162//US KTrader::OfferList::ConstIterator it; 162//US KTrader::OfferList::ConstIterator it;
163//US for ( it = plugins.begin(); it != plugins.end(); ++it ) { 163//US for ( it = plugins.begin(); it != plugins.end(); ++it ) {
164//US QVariant tmp = (*it)->property( "X-KDE-ResourceFamily" ); 164//US QVariant tmp = (*it)->property( "X-KDE-ResourceFamily" );
165//US QString family = tmp.toString(); 165//US QString family = tmp.toString();
166 166 QStringList families;
167 QString family = "contact"; 167 families << "contact" << "sync-contacts";
168 for ( QStringList::Iterator it = families.begin(); it != families.end(); ++it )
169 {
170 QString family = (*it);
168 if ( !family.isEmpty() ) { 171 if ( !family.isEmpty() ) {
169 if ( !mFamilyMap.contains( family ) ) { 172 if ( !mFamilyMap.contains( family ) ) {
170 mCurrentManager = new Manager<Resource>( family ); 173 mCurrentManager = new Manager<Resource>( family );
171 if ( mCurrentManager ) { 174 if ( mCurrentManager ) {
172 mFamilyMap.append( family ); 175 mFamilyMap.append( family );
173 mCurrentManager->addListener( this ); 176 mCurrentManager->addListener( this );
174 177
175 ResourcePageInfo info; 178 ResourcePageInfo info;
176 info.mManager = mCurrentManager; 179 info.mManager = mCurrentManager;
177 QString configDir = KGlobal::dirs()->saveLocation( "config" ); 180 QString configDir = KGlobal::dirs()->saveLocation( "config" );
178 //QString configDir = KStandardDirs::appDir() + "/config"; 181 //QString configDir = KStandardDirs::appDir() + "/config";
179 if ( family == "contact" && QFile::exists( configDir + "/kabcrc" ) ) { 182 if ( family == "contact" && QFile::exists( configDir + "/kabcrc" ) ) {
@@ -181,25 +184,25 @@ void ConfigPage::load()
181 } else if ( family == "calendar" && QFile::exists( configDir + "/kcalrc" ) ) { 184 } else if ( family == "calendar" && QFile::exists( configDir + "/kcalrc" ) ) {
182 info.mConfig = new KConfig( locateLocal( "config", "kcalrc" ) ); 185 info.mConfig = new KConfig( locateLocal( "config", "kcalrc" ) );
183 } else { 186 } else {
184 QString configFile = locateLocal( "config", QString( "kresources/%1/stdrc" ).arg( family ) ); 187 QString configFile = locateLocal( "config", QString( "kresources/%1/stdrc" ).arg( family ) );
185 info.mConfig = new KConfig( configFile ); 188 info.mConfig = new KConfig( configFile );
186 } 189 }
187 info.mManager->readConfig( info.mConfig ); 190 info.mManager->readConfig( info.mConfig );
188 191
189 mInfoMap.append( info ); 192 mInfoMap.append( info );
190 } 193 }
191 } 194 }
192 } 195 }
193//US } 196 }
194 mCurrentManager = 0; 197 mCurrentManager = 0;
195 198
196 mFamilyCombo->insertStringList( mFamilyMap ); 199 mFamilyCombo->insertStringList( mFamilyMap );
197 200
198 int currentFamily = mConfig->readNumEntry( "CurrentFamily", 0 ); 201 int currentFamily = mConfig->readNumEntry( "CurrentFamily", 0 );
199 mFamilyCombo->setCurrentItem( currentFamily ); 202 mFamilyCombo->setCurrentItem( currentFamily );
200 slotFamilyChanged( currentFamily ); 203 slotFamilyChanged( currentFamily );
201} 204}
202 205
203void ConfigPage::save() 206void ConfigPage::save()
204{ 207{
205 saveResourceSettings(); 208 saveResourceSettings();