Diffstat (limited to 'microkde/kresources/configpage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kresources/configpage.cpp | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp index 02c5fb1..533be51 100644 --- a/microkde/kresources/configpage.cpp +++ b/microkde/kresources/configpage.cpp @@ -52,19 +52,16 @@ $Id$ //US #include <qpushbutton.h> #include <qfile.h> #include <kglobal.h> using namespace KRES; -const QString ConfigPage::syncfamily = "syncprofiles"; - - class ConfigViewItem : public QCheckListItem { public: ConfigViewItem( QListView *parent, Resource* resource ) : QCheckListItem( parent, resource->resourceName(), CheckBox ), mResource( resource ), mIsStandard( false ) { @@ -179,39 +176,37 @@ void ConfigPage::load() //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(); QStringList families; - families << "contact" << syncfamily; + families << "contact"; 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, (family == syncfamily) ); + 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 if ( family == syncfamily && QFile::exists( configDir + "/kabcsyncrc" ) ) { - info.mConfig = new KConfig( locateLocal( "config", "kabcsyncrc" ) ); } else { QString configFile = locateLocal( "config", QString( "kresources/%1/stdrc" ).arg( family ) ); info.mConfig = new KConfig( configFile ); } info.mManager->readConfig( info.mConfig ); mInfoMap.append( info ); } @@ -305,50 +300,34 @@ void ConfigPage::slotAdd() return; QStringList types = mCurrentManager->resourceTypeNames(); QStringList descs = mCurrentManager->resourceTypeDescriptions(); bool ok = false; QString desc; - if (mFamily == syncfamily) - { - desc = QInputDialog::getItem( i18n( "Sync Configuration" ), - i18n( "Select resource type for the new sync profile:" ), descs, 0, - false, &ok, this ); - } - else - { - desc = QInputDialog::getItem( i18n( "Resource Configuration" ), + desc = QInputDialog::getItem( i18n( "Resource Configuration" ), i18n( "Select type of the new resource:" ), descs, 0, false, &ok, this ); - } if ( !ok ) return; QString type = types[ descs.findIndex( desc ) ]; // Create new resource Resource *resource = mCurrentManager->createResource( type ); if ( !resource ) { KMessageBox::error( this, i18n("Unable to create resource of type '%1'.") .arg( type ) ); return; } - if (mFamily == syncfamily) - { - resource->setResourceName( type + "-syncprofile" ); - } - else - { - resource->setResourceName( type + "-resource" ); - } + resource->setResourceName( type + "-resource" ); ConfigDialog dlg( this, mFamily, resource, "KRES::ConfigDialog" ); if ( dlg.exec() ) { mCurrentManager->add( resource ); ConfigViewItem *item = new ConfigViewItem( mListView, resource ); |