author | ulf69 <ulf69> | 2004-08-02 18:10:42 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-02 18:10:42 (UTC) |
commit | 09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7 (patch) (side-by-side diff) | |
tree | 4060a8dad4d840c92c62c16f9c51e733da51e33c /microkde | |
parent | 7520e7cb4f10eb535efd457c539a15a0b7e52137 (diff) | |
download | kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.zip kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.tar.gz kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.tar.bz2 |
add changes that resources can be used for syncing as well
-rw-r--r-- | microkde/kresources/managerimpl.h | 19 | ||||
-rw-r--r-- | microkde/kresources/resource.cpp | 5 | ||||
-rw-r--r-- | microkde/kresources/resource.h | 25 |
3 files changed, 39 insertions, 10 deletions
diff --git a/microkde/kresources/managerimpl.h b/microkde/kresources/managerimpl.h index a049bcc..0425279 100644 --- a/microkde/kresources/managerimpl.h +++ b/microkde/kresources/managerimpl.h @@ -22,4 +22,11 @@ */ +/* +Enhanced Version of the file for platform independent KDE tools. +Copyright (c) 2004 Ulf Schenk + +$Id$ +*/ + #ifndef KRESOURCES_MANAGERIMPL_H #define KRESOURCES_MANAGERIMPL_H @@ -59,5 +66,5 @@ class ManagerImpl : public QObject Q_OBJECT public: - ManagerImpl( const QString &family ); + ManagerImpl( const QString &family, bool syncable); ~ManagerImpl(); @@ -84,4 +91,9 @@ class ManagerImpl : public QObject void setListener( ManagerImplListener *listener ); + /** + Return true, if the manager manages syncable resources. + */ + bool manageSyncable() const; + public slots: void resourceChanged( Resource *resource ); @@ -92,8 +104,8 @@ class ManagerImpl : public QObject private: void createStandardConfig(); - + Resource *readResourceConfig( const QString& identifier, bool checkActive ); void writeResourceConfig( Resource *resource, bool checkActive ); - + void removeResource( Resource *resource ); Resource *getResource( Resource *resource ); @@ -101,4 +113,5 @@ class ManagerImpl : public QObject QString mFamily; + bool mSyncable; KConfig *mConfig; KConfig *mStdConfig; diff --git a/microkde/kresources/resource.cpp b/microkde/kresources/resource.cpp index 991d53d..4f69540 100644 --- a/microkde/kresources/resource.cpp +++ b/microkde/kresources/resource.cpp @@ -52,5 +52,5 @@ Resource::Resource( const KConfig* config ) //US compiler claimed that const discards qualifier - KConfig* cfg = (KConfig*)config; + KConfig* cfg = (KConfig*)config; if ( cfg ) { #ifdef _WIN32_ @@ -83,5 +83,5 @@ Resource::~Resource() void Resource::writeConfig( KConfig* config ) { - + config->writeEntry( "ResourceType", d->mType ); @@ -192,2 +192,3 @@ void Resource::dump() const kdDebug(5650) << " IsOpen: " << ( d->mIsOpen ? "yes" : "no" ) << endl; } + diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h index 64e7424..c9202c9 100644 --- a/microkde/kresources/resource.h +++ b/microkde/kresources/resource.h @@ -41,4 +41,5 @@ namespace KRES { class ConfigWidget; +class SyncWidget; /** @@ -321,4 +322,9 @@ class Resource : public QObject virtual QString resourceName() const; + + + virtual bool isSyncable() const = 0; + + /** Sets, if the resource is active. @@ -339,4 +345,5 @@ class Resource : public QObject virtual void dump() const; + protected: /** @@ -368,8 +375,10 @@ class PluginFactoryBase : public KLibFactory { public: - virtual Resource *resource( const KConfig *config ) = 0; + virtual Resource *resource( const KConfig *config, bool syncable ) = 0; virtual ConfigWidget *configWidget( QWidget *parent ) = 0; + virtual SyncWidget *syncWidget( QWidget *parent ) = 0; + protected: virtual QObject* createObject( QObject*, const char*, const char*, @@ -380,17 +389,23 @@ class PluginFactoryBase : public KLibFactory }; -template<class TR,class TC> +template<class TR,class TC, class TS> class PluginFactory : public PluginFactoryBase { public: - Resource *resource( const KConfig *config ) + Resource *resource( const KConfig *config, bool syncable ) { - return new TR( config ); + return new TR( config, syncable ); } - + ConfigWidget *configWidget( QWidget *parent ) { return new TC( parent ); } + + virtual SyncWidget *syncWidget( QWidget *parent ) + { + return new TS( parent ); + } + }; |