summaryrefslogtreecommitdiffabout
path: root/microkde
authorulf69 <ulf69>2004-08-02 18:10:42 (UTC)
committer ulf69 <ulf69>2004-08-02 18:10:42 (UTC)
commit09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7 (patch) (unidiff)
tree4060a8dad4d840c92c62c16f9c51e733da51e33c /microkde
parent7520e7cb4f10eb535efd457c539a15a0b7e52137 (diff)
downloadkdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.zip
kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.tar.gz
kdepimpi-09e8e7e5d4c3cafcf2b05511e5c78717fb5380e7.tar.bz2
add changes that resources can be used for syncing as well
Diffstat (limited to 'microkde') (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 @@
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24/*
25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk
27
28$Id$
29*/
30
24#ifndef KRESOURCES_MANAGERIMPL_H 31#ifndef KRESOURCES_MANAGERIMPL_H
25#define KRESOURCES_MANAGERIMPL_H 32#define KRESOURCES_MANAGERIMPL_H
26 33
@@ -58,7 +65,7 @@ class ManagerImpl : public QObject
58{ 65{
59 Q_OBJECT 66 Q_OBJECT
60 public: 67 public:
61 ManagerImpl( const QString &family ); 68 ManagerImpl( const QString &family, bool syncable);
62 ~ManagerImpl(); 69 ~ManagerImpl();
63 70
64 void readConfig( KConfig * ); 71 void readConfig( KConfig * );
@@ -83,6 +90,11 @@ class ManagerImpl : public QObject
83 90
84 void setListener( ManagerImplListener *listener ); 91 void setListener( ManagerImplListener *listener );
85 92
93 /**
94 Return true, if the manager manages syncable resources.
95 */
96 bool manageSyncable() const;
97
86 public slots: 98 public slots:
87 void resourceChanged( Resource *resource ); 99 void resourceChanged( Resource *resource );
88 100
@@ -100,6 +112,7 @@ class ManagerImpl : public QObject
100 Resource *getResource( const QString& identifier ); 112 Resource *getResource( const QString& identifier );
101 113
102 QString mFamily; 114 QString mFamily;
115 bool mSyncable;
103 KConfig *mConfig; 116 KConfig *mConfig;
104 KConfig *mStdConfig; 117 KConfig *mStdConfig;
105 Resource *mStandard; 118 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
191 kdDebug(5650) << " Active: " << ( d->mActive ? "yes" : "no" ) << endl; 191 kdDebug(5650) << " Active: " << ( d->mActive ? "yes" : "no" ) << endl;
192 kdDebug(5650) << " IsOpen: " << ( d->mIsOpen ? "yes" : "no" ) << endl; 192 kdDebug(5650) << " IsOpen: " << ( d->mIsOpen ? "yes" : "no" ) << endl;
193} 193}
194
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;
40namespace KRES { 40namespace KRES {
41 41
42class ConfigWidget; 42class ConfigWidget;
43class SyncWidget;
43 44
44/** 45/**
45 * @internal 46 * @internal
@@ -320,6 +321,11 @@ class Resource : public QObject
320 */ 321 */
321 virtual QString resourceName() const; 322 virtual QString resourceName() const;
322 323
324
325
326 virtual bool isSyncable() const = 0;
327
328
323 /** 329 /**
324 Sets, if the resource is active. 330 Sets, if the resource is active.
325 */ 331 */
@@ -338,6 +344,7 @@ class Resource : public QObject
338 */ 344 */
339 virtual void dump() const; 345 virtual void dump() const;
340 346
347
341 protected: 348 protected:
342 /** 349 /**
343 * Open this resource. When called, the resource must be in 350 * Open this resource. When called, the resource must be in
@@ -367,10 +374,12 @@ class Resource : public QObject
367class PluginFactoryBase : public KLibFactory 374class PluginFactoryBase : public KLibFactory
368{ 375{
369 public: 376 public:
370 virtual Resource *resource( const KConfig *config ) = 0; 377 virtual Resource *resource( const KConfig *config, bool syncable ) = 0;
371 378
372 virtual ConfigWidget *configWidget( QWidget *parent ) = 0; 379 virtual ConfigWidget *configWidget( QWidget *parent ) = 0;
373 380
381 virtual SyncWidget *syncWidget( QWidget *parent ) = 0;
382
374 protected: 383 protected:
375 virtual QObject* createObject( QObject*, const char*, const char*, 384 virtual QObject* createObject( QObject*, const char*, const char*,
376 const QStringList & ) 385 const QStringList & )
@@ -379,19 +388,25 @@ class PluginFactoryBase : public KLibFactory
379 } 388 }
380}; 389};
381 390
382template<class TR,class TC> 391template<class TR,class TC, class TS>
383class PluginFactory : public PluginFactoryBase 392class PluginFactory : public PluginFactoryBase
384{ 393{
385 public: 394 public:
386 Resource *resource( const KConfig *config ) 395 Resource *resource( const KConfig *config, bool syncable )
387 { 396 {
388 return new TR( config ); 397 return new TR( config, syncable );
389 } 398 }
390 399
391 ConfigWidget *configWidget( QWidget *parent ) 400 ConfigWidget *configWidget( QWidget *parent )
392 { 401 {
393 return new TC( parent ); 402 return new TC( parent );
394 } 403 }
404
405 virtual SyncWidget *syncWidget( QWidget *parent )
406 {
407 return new TS( parent );
408 }
409
395}; 410};
396 411
397 412