author | ulf69 <ulf69> | 2004-10-13 21:27:10 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-13 21:27:10 (UTC) |
commit | 737183a5abd7d7b02048e8a939bafd0a8e803918 (patch) (side-by-side diff) | |
tree | ddacf864a06a6669911b1d48862e564399eeb33b /microkde/kresources | |
parent | 7bb6c5f55d29ad4632b1f5c7361eee4c0d8b7cb0 (diff) | |
download | kdepimpi-737183a5abd7d7b02048e8a939bafd0a8e803918.zip kdepimpi-737183a5abd7d7b02048e8a939bafd0a8e803918.tar.gz kdepimpi-737183a5abd7d7b02048e8a939bafd0a8e803918.tar.bz2 |
removal of syncresources
-rw-r--r-- | microkde/kresources/configdialog.cpp | 105 | ||||
-rw-r--r-- | microkde/kresources/configdialog.h | 5 | ||||
-rw-r--r-- | microkde/kresources/configpage.cpp | 25 | ||||
-rw-r--r-- | microkde/kresources/factory.cpp | 38 | ||||
-rw-r--r-- | microkde/kresources/factory.h | 15 | ||||
-rw-r--r-- | microkde/kresources/manager.h | 12 | ||||
-rw-r--r-- | microkde/kresources/managerimpl.cpp | 13 | ||||
-rw-r--r-- | microkde/kresources/managerimpl.h | 8 | ||||
-rw-r--r-- | microkde/kresources/resource.cpp | 1 | ||||
-rw-r--r-- | microkde/kresources/resource.h | 24 |
10 files changed, 38 insertions, 208 deletions
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp index 030b547..24e82bc 100644 --- a/microkde/kresources/configdialog.cpp +++ b/microkde/kresources/configdialog.cpp @@ -38,53 +38,48 @@ #include <kdialog.h> #include <klineedit.h> #include "factory.h" #include "configwidget.h" #include "configdialog.h" -#include "syncwidget.h" using namespace KRES; ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, Resource* resource, const char *name ) - : KDialogBase( parent, name, true, resource->isSyncable()?i18n( "Sync Profile Configuration" ):i18n( "Resource Configuration" ), - Ok|Cancel, Ok, true )/*, mConfig( config )*/, mSyncWidget_Settings(0), mSyncWidget_Conflicts(0),mSyncWidget_Remote(0), mResource( resource ), mPersistentReadOnly(false) + : KDialogBase( parent, name, true, i18n( "Resource Configuration" ), + Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false) { Factory *factory = Factory::self( resourceFamily ); //US resize( 250, 240 ); resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240)); QFrame *main; - if (!mResource->isSyncable()) main = plainPage(); - else - main = addPage("Profile"); QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() ); QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); generalGroupBox->layout()->setSpacing( spacingHint() ); generalGroupBox->setTitle( i18n( "General Settings" ) ); - new QLabel( mResource->isSyncable()?i18n( "Profile Name:" ):i18n( "Name:" ), generalGroupBox ); + new QLabel( i18n( "Name:" ), generalGroupBox ); mName = new KLineEdit( generalGroupBox ); - if (!mResource->isSyncable()) { new QLabel("", generalGroupBox ); mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); mReadOnly->setChecked( mResource->readOnly() ); + new QLabel("", generalGroupBox ); mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox ); mIncludeInSync->setChecked( mResource->includeInSync() ); - } mName->setText( mResource->resourceName() ); mainLayout->addWidget( generalGroupBox ); QGroupBox *resourceGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); @@ -96,73 +91,22 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, mainLayout->addStretch(); mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox ); if ( mConfigWidget ) { connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), SLOT( setReadOnly( bool ) ) ); + connect( mConfigWidget, SIGNAL( setIncludeInSync( bool ) ), + SLOT( setIncludeInSync( bool ) ) ); connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ), SLOT( setPersistentReadOnly( bool ) ) ); mConfigWidget->setInEditMode( false ); mConfigWidget->loadSettings( mResource ); mConfigWidget->show(); } - if (mResource->isSyncable()) - { - SyncWidgetContainer* c = factory->syncWidgetContainer( resource->type() ); - - QFrame* syncPage = addPage("Settings"); - QVBoxLayout *syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() ); - mSyncWidget_Settings = c->generateSettingsTab(syncPage); - syncLayout->addWidget( mSyncWidget_Settings ); - - syncPage = addPage("Conflicts"); - syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() ); - mSyncWidget_Conflicts = c->generateConflictsTab(syncPage); - syncLayout->addWidget( mSyncWidget_Conflicts ); - - syncPage = addPage("Remote"); - syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() ); - mSyncWidget_Remote = c->generateRemoteTab(syncPage); - syncLayout->addWidget( mSyncWidget_Remote ); - - - mSyncWidget_Settings->setInEditMode( false ); - mSyncWidget_Settings->loadSettings( mResource ); - mSyncWidget_Settings->show(); - - mSyncWidget_Conflicts->setInEditMode( false ); - mSyncWidget_Conflicts->loadSettings( mResource ); - mSyncWidget_Conflicts->show(); - - mSyncWidget_Remote->setInEditMode( false ); - mSyncWidget_Remote->loadSettings( mResource ); - mSyncWidget_Remote->show(); - - delete c; - -// QGroupBox *syncGroupBox = new QGroupBox( 2, Qt::Horizontal, syncPage ); -// syncGroupBox->layout()->setSpacing( spacingHint()); -// syncGroupBox->setTitle( i18n( "Syncronize Preferences" ) ); -// syncLayout->addWidget( syncGroupBox ); - -// syncLayout->addStretch(); -/*US - mSyncWidget = factory->syncWidget( resource->type(), syncPage ); - syncLayout->addWidget( mSyncWidget ); - if ( mSyncWidget ) { - mSyncWidget->setInEditMode( false ); - mSyncWidget->loadSettings( mResource ); - mSyncWidget->show(); - } - */ - } - - - connect( mName, SIGNAL( textChanged(const QString &)), SLOT( slotNameChanged(const QString &))); slotNameChanged( mName->text() ); @@ -172,75 +116,64 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, } void ConfigDialog::setInEditMode( bool value ) { if ( mConfigWidget ) mConfigWidget->setInEditMode( value ); - - if ( mSyncWidget_Settings ) - mSyncWidget_Settings->setInEditMode( value ); - if ( mSyncWidget_Conflicts ) - mSyncWidget_Conflicts->setInEditMode( value ); - if ( mSyncWidget_Remote ) - mSyncWidget_Remote->setInEditMode( value ); - } void ConfigDialog::slotNameChanged( const QString &text) { enableButtonOK( !text.isEmpty() ); } void ConfigDialog::setReadOnly( bool value ) { - if (!mResource->isSyncable()) { - if (mPersistentReadOnly == false) mReadOnly->setChecked( value ); else mReadOnly->setChecked( true ); } + +void ConfigDialog::setIncludeInSync( bool value ) +{ + if (mPersistentReadOnly == false) + mIncludeInSync->setChecked( value ); + else + mIncludeInSync->setChecked( true ); } void ConfigDialog::setPersistentReadOnly( bool value ) { - if (!mResource->isSyncable()) { - mPersistentReadOnly = value; - if (value == true) + if (value == true) { setReadOnly( true ); + setIncludeInSync( true ); + } mReadOnly->setEnabled( !value ); + mIncludeInSync->setEnabled (!value ); } -} + void ConfigDialog::accept() { if ( mName->text().isEmpty() ) { - KMessageBox::sorry( this, mResource->isSyncable()?i18n( "Please enter a profile name" ):i18n( "Please enter a resource name" ) ); + KMessageBox::sorry( this, i18n( "Please enter a resource name" ) ); return; } mResource->setResourceName( mName->text() ); - if (!mResource->isSyncable()) mResource->setReadOnly( mReadOnly->isChecked() ); mResource->setIncludeInSync( mIncludeInSync->isChecked() ); if ( mConfigWidget ) { // First save generic information // Also save setting of specific resource type mConfigWidget->saveSettings( mResource ); } - if ( mSyncWidget_Settings ) - mSyncWidget_Settings->saveSettings( mResource ); - if ( mSyncWidget_Conflicts ) - mSyncWidget_Conflicts->saveSettings( mResource ); - if ( mSyncWidget_Remote ) - mSyncWidget_Remote->saveSettings( mResource ); - - KDialog::accept(); } //US #include "configdialog.moc" diff --git a/microkde/kresources/configdialog.h b/microkde/kresources/configdialog.h index ed3ecab..b205975 100644 --- a/microkde/kresources/configdialog.h +++ b/microkde/kresources/configdialog.h @@ -28,13 +28,12 @@ class KLineEdit; class QCheckBox; class KButtonBox; namespace KRES { class Resource; class ConfigWidget; - class SyncWidget; class ConfigDialog : public KDialogBase { Q_OBJECT public: // Resource=0: create new resource @@ -43,20 +42,18 @@ class ConfigDialog : public KDialogBase void setInEditMode( bool value ); protected slots: void accept(); void setReadOnly( bool value ); + void setIncludeInSync( bool value ); void setPersistentReadOnly( bool value ); void slotNameChanged( const QString &text); private: ConfigWidget *mConfigWidget; - SyncWidget *mSyncWidget_Settings; - SyncWidget *mSyncWidget_Conflicts; - SyncWidget *mSyncWidget_Remote; Resource* mResource; KLineEdit *mName; QCheckBox *mReadOnly; QCheckBox *mIncludeInSync; //US add a persistent readonly flag. We need that for opie and qtopia addressbooks. 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 @@ -54,15 +54,12 @@ $Id$ #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 ), @@ -181,35 +178,33 @@ void ConfigPage::load() //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 ); @@ -307,24 +302,15 @@ void ConfigPage::slotAdd() 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" ), i18n( "Select type of the new resource:" ), descs, 0, false, &ok, this ); - } if ( !ok ) return; QString type = types[ descs.findIndex( desc ) ]; @@ -333,20 +319,13 @@ void ConfigPage::slotAdd() 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" ); - } ConfigDialog dlg( this, mFamily, resource, "KRES::ConfigDialog" ); if ( dlg.exec() ) { mCurrentManager->add( resource ); diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp index e44fce3..4e4456d 100644 --- a/microkde/kresources/factory.cpp +++ b/microkde/kresources/factory.cpp @@ -184,46 +184,12 @@ ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent ) return 0; } return wdg; } -SyncWidgetContainer *Factory::syncWidgetContainer( const QString& type ) -{ - if ( type.isEmpty() || !mTypeMap.contains( type ) ) - return 0; - -//US KService::Ptr ptr = mTypeMap[ type ]; -//US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() ); - PluginInfo* pi = mTypeMap[ type ]; - KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() ); - if ( !factory ) { - qDebug("KRES::Factory::syncWidget(): Factory creation failed for library %s", pi->library.latin1()); - kdDebug() << "KRES::Factory::syncWidget(): Factory creation failed" << endl; - return 0; - } - - PluginFactoryBase *pluginFactory = static_cast<PluginFactoryBase *>( factory ); - - if ( !pluginFactory ) { - qDebug("KRES::Factory::syncWidget(): no plugin factory for library %s", pi->library.latin1()); - kdDebug() << "KRES::Factory::syncWidget(): no plugin factory." << endl; - return 0; - } - - SyncWidgetContainer *wdg = pluginFactory->syncWidgetContainer( ); - if ( !wdg ) { -//US kdDebug() << "'" << ptr->library() << "' is not a " + mResourceFamily + " plugin." << endl; - qDebug("%s is not a %s plugin.", pi->library.latin1(), mResourceFamily.latin1()); - return 0; - } - return wdg; - -} - - QString Factory::typeName( const QString &type ) const { if ( type.isEmpty() || !mTypeMap.contains( type ) ) return QString(); @@ -242,13 +208,13 @@ QString Factory::typeDescription( const QString &type ) const //US KService::Ptr ptr = mTypeMap[ type ]; //US return ptr->comment(); PluginInfo* pi = mTypeMap[ type ]; return pi->descriptionLabel; } -Resource *Factory::resource( const QString& type, const KConfig *config, bool syncable ) +Resource *Factory::resource( const QString& type, const KConfig *config ) { if ( type.isEmpty() || !mTypeMap.contains( type ) ) return 0; @@ -273,13 +239,13 @@ Resource *Factory::resource( const QString& type, const KConfig *config, bool sy if ( !pluginFactory ) { qDebug("KRES::Factory::resource(): no plugin factory for library %s", pi->library.latin1()); kdDebug() << "KRES::Factory::resource(): no plugin factory." << endl; return 0; } - Resource *resource = pluginFactory->resource( config, syncable ); + Resource *resource = pluginFactory->resource( config ); if ( !resource ) { //US kdDebug() << "'" << ptr->library() << "' is not a " + mResourceFamily + " plugin." << endl; qDebug("%s is not a %s plugin.", pi->library.latin1(), mResourceFamily.latin1()); return 0; } diff --git a/microkde/kresources/factory.h b/microkde/kresources/factory.h index 0e4231b..ea01b23 100644 --- a/microkde/kresources/factory.h +++ b/microkde/kresources/factory.h @@ -31,13 +31,12 @@ #include "resource.h" namespace KRES { -class SyncWidgetContainer; class ConfigWidget; //US struct PluginInfo { QString library; @@ -84,32 +83,20 @@ class Factory * @param resource The resource to be editted. * @param parent The parent widget */ ConfigWidget *configWidget( const QString& type, QWidget *parent = 0 ); /** - * Returns the sync widget for the given resource type, - * or a null pointer if resource type doesn't exist, - * or a null pointer if resource does not support syncing. - * - * @param type The type of the resource, returned by @ref resources() - * @param resource The resource to be editted. - * @param parent The parent widget - */ - SyncWidgetContainer *syncWidgetContainer( const QString& type ); - - /** * Returns a pointer to a resource object or a null pointer * if resource type doesn't exist. * * @param type The type of the resource, returned by @ref resources() * @param ab The address book, the resource should belong to * @param config The config object where the resource get it settings from, or 0 if a new resource should be created. - * @param syncable If the resource should support syncing capabilities. */ - Resource *resource( const QString& type, const KConfig *config, bool syncable ); + Resource *resource( const QString& type, const KConfig *config); /** * Returns a list of all available resource types. */ QStringList typeNames() const; diff --git a/microkde/kresources/manager.h b/microkde/kresources/manager.h index 7e9e19a..0e6f838 100644 --- a/microkde/kresources/manager.h +++ b/microkde/kresources/manager.h @@ -164,23 +164,18 @@ class Manager : private ManagerImplListener it.mList = mImpl->resourceList(); return it; } bool isEmpty() const { return mImpl->resourceList()->isEmpty(); } - /** - Return true, if the manager manages syncable resources. - */ - bool manageSyncable() { return mImpl->manageSyncable(); } - - Manager( const QString &family, bool syncable ) + Manager( const QString &family ) { mFactory = Factory::self( family ); // The managerimpl will use the same Factory object as the manager // because of the Factory::self() pattern - mImpl = new ManagerImpl( family, syncable ); + mImpl = new ManagerImpl( family ); mImpl->setListener( this ); mListeners = new QPtrList<ManagerListener<T> >; } virtual ~Manager() @@ -257,17 +252,16 @@ class Manager : private ManagerImplListener not added to the manager, the application has to do that. Returns a pointer to a resource object or a null pointer if resource type doesn't exist. @param type The type of the resource, one of those returned by @ref resourceTypeNames() - * @param syncable If the resource should support syncing capabilities. */ T *createResource( const QString& type ) { - return (T *)( mFactory->resource( type, 0, mImpl->manageSyncable() ) ); + return (T *)( mFactory->resource( type, 0 ) ); } /** Returns a list of the names of all available resource types. */ QStringList resourceTypeNames() const diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp index 3655f50..81bbbec 100644 --- a/microkde/kresources/managerimpl.cpp +++ b/microkde/kresources/managerimpl.cpp @@ -38,14 +38,14 @@ $Id$ #include "resource.h" #include "factory.h" #include "managerimpl.h" using namespace KRES; -ManagerImpl::ManagerImpl( const QString &family, bool syncable ) - : mFamily( family ), mSyncable(syncable), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ), +ManagerImpl::ManagerImpl( const QString &family ) + : mFamily( family ), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ), mFactory( 0 ) { kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl; @@ -265,13 +265,13 @@ Resource* ManagerImpl::readResourceConfig( const QString& identifier, // such that gourp info not avail on win32 plugins // to fix that, it would be a looooot of work mConfig->setTempGroup( "Resource_" + identifier ); #endif QString type = mConfig->readEntry( "ResourceType" ); QString name = mConfig->readEntry( "ResourceName" ); - Resource *resource = mFactory->resource( type, mConfig, mSyncable ); + Resource *resource = mFactory->resource( type, mConfig ); if ( !resource ) { qDebug("Failed to create resource with id %s ",identifier.latin1() ); return 0; } if ( resource->identifier().isEmpty() ) @@ -361,14 +361,7 @@ Resource* ManagerImpl::getResource( const QString& identifier ) if ( (*it)->identifier() == identifier ) return *it; } return 0; } -/** - Return true, if the manager manages syncable resources. -*/ -bool ManagerImpl::manageSyncable() const -{ - return mSyncable; -} diff --git a/microkde/kresources/managerimpl.h b/microkde/kresources/managerimpl.h index 0425279..56a2db6 100644 --- a/microkde/kresources/managerimpl.h +++ b/microkde/kresources/managerimpl.h @@ -62,13 +62,13 @@ class ManagerImplListener Do not use this class directly. Use ResourceManager instead */ class ManagerImpl : public QObject { Q_OBJECT public: - ManagerImpl( const QString &family, bool syncable); + ManagerImpl( const QString &family); ~ManagerImpl(); void readConfig( KConfig * ); void writeConfig( KConfig * ); void add( Resource *resource, bool useDCOP = true ); @@ -87,17 +87,12 @@ class ManagerImpl : public QObject QPtrList<Resource> resources( bool active ); QStringList resourceNames(); void setListener( ManagerImplListener *listener ); - /** - Return true, if the manager manages syncable resources. - */ - bool manageSyncable() const; - public slots: void resourceChanged( Resource *resource ); private: // dcop calls @@ -109,13 +104,12 @@ class ManagerImpl : public QObject void removeResource( Resource *resource ); Resource *getResource( Resource *resource ); Resource *getResource( const QString& identifier ); QString mFamily; - bool mSyncable; KConfig *mConfig; KConfig *mStdConfig; Resource *mStandard; Factory *mFactory; Resource::List mResources; ManagerImplListener *mListener; diff --git a/microkde/kresources/resource.cpp b/microkde/kresources/resource.cpp index f79bcd0..cccd485 100644 --- a/microkde/kresources/resource.cpp +++ b/microkde/kresources/resource.cpp @@ -195,10 +195,11 @@ void Resource::dump() const kdDebug(5650) << "Resource:" << endl; kdDebug(5650) << " Name: " << d->mName << endl; kdDebug(5650) << " Identifier: " << d->mIdentifier << endl; kdDebug(5650) << " Type: " << d->mType << endl; kdDebug(5650) << " OpenCount: " << d->mOpenCount << endl; kdDebug(5650) << " ReadOnly: " << ( d->mReadOnly ? "yes" : "no" ) << endl; + kdDebug(5650) << " IncludeInSync: " << ( d->mIncludeInSync ? "yes" : "no" ) << endl; kdDebug(5650) << " Active: " << ( d->mActive ? "yes" : "no" ) << endl; kdDebug(5650) << " IsOpen: " << ( d->mIsOpen ? "yes" : "no" ) << endl; } diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h index 70b5613..ed5af96 100644 --- a/microkde/kresources/resource.h +++ b/microkde/kresources/resource.h @@ -37,13 +37,12 @@ class KConfig; namespace KRES { class ConfigWidget; -class SyncWidgetContainer; /** * @internal * @libdoc The KDE Resource library * * NOTE: this library is NOT (YET?) PUBLIC. Do not publish this @@ -229,13 +228,13 @@ link_DATA= resourceexample.desktop */ /** * A @ref Resource is a ... * * A subclass should reimplement at least the constructor and the - * @ref writeConfig method. +k * @ref writeConfig method. * */ class Resource : public QObject { Q_OBJECT @@ -320,17 +319,12 @@ class Resource : public QObject /** * Returns the name of resource. */ virtual QString resourceName() const; - - - virtual bool isSyncable() const = 0; - - /** Sets, if the resource is active. */ void setActive( bool active ); /** @@ -373,45 +367,37 @@ class Resource : public QObject ResourcePrivate *d; }; class PluginFactoryBase : public KLibFactory { public: - virtual Resource *resource( const KConfig *config, bool syncable ) = 0; + virtual Resource *resource( const KConfig *config) = 0; virtual ConfigWidget *configWidget( QWidget *parent ) = 0; - virtual SyncWidgetContainer *syncWidgetContainer() = 0; - protected: virtual QObject* createObject( QObject*, const char*, const char*, const QStringList & ) { return 0; } }; -template<class TR,class TC, class TS> +template<class TR,class TC> class PluginFactory : public PluginFactoryBase { public: - Resource *resource( const KConfig *config, bool syncable ) + Resource *resource( const KConfig *config) { - return new TR( config, syncable ); + return new TR( config ); } ConfigWidget *configWidget( QWidget *parent ) { return new TC( parent ); } - - SyncWidgetContainer *syncWidgetContainer() - { - return new TS(); - } - }; } |