summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--microkde/kresources/managerimpl.h15
-rw-r--r--microkde/kresources/resource.cpp1
-rw-r--r--microkde/kresources/resource.h23
3 files changed, 34 insertions, 5 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
@@ -21,6 +21,13 @@
Boston, MA 02111-1307, USA.
*/
+/*
+Enhanced Version of the file for platform independent KDE tools.
+Copyright (c) 2004 Ulf Schenk
+
+$Id$
+*/
+
#ifndef KRESOURCES_MANAGERIMPL_H
#define KRESOURCES_MANAGERIMPL_H
@@ -58,7 +65,7 @@ class ManagerImpl : public QObject
{
Q_OBJECT
public:
- ManagerImpl( const QString &family );
+ ManagerImpl( const QString &family, bool syncable);
~ManagerImpl();
void readConfig( KConfig * );
@@ -83,6 +90,11 @@ 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 );
@@ -100,6 +112,7 @@ class ManagerImpl : public QObject
Resource *getResource( const QString& identifier );
QString mFamily;
+ bool mSyncable;
KConfig *mConfig;
KConfig *mStdConfig;
Resource *mStandard;
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
@@ -191,3 +191,4 @@ void Resource::dump() const
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 64e7424..c9202c9 100644
--- a/microkde/kresources/resource.h
+++ b/microkde/kresources/resource.h
@@ -40,6 +40,7 @@ class KConfig;
namespace KRES {
class ConfigWidget;
+class SyncWidget;
/**
* @internal
@@ -320,6 +321,11 @@ class Resource : public QObject
*/
virtual QString resourceName() const;
+
+
+ virtual bool isSyncable() const = 0;
+
+
/**
Sets, if the resource is active.
*/
@@ -338,6 +344,7 @@ class Resource : public QObject
*/
virtual void dump() const;
+
protected:
/**
* Open this resource. When called, the resource must be in
@@ -367,10 +374,12 @@ class Resource : public QObject
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*,
const QStringList & )
@@ -379,19 +388,25 @@ 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 );
+ }
+
};