summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/managerimpl.cpp
Unidiff
Diffstat (limited to 'microkde/kresources/managerimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kresources/managerimpl.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp
index 785b6b4..3655f50 100644
--- a/microkde/kresources/managerimpl.cpp
+++ b/microkde/kresources/managerimpl.cpp
@@ -18,12 +18,19 @@
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
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#include <kglobal.h> 31#include <kglobal.h>
25 32
26#include <kapplication.h> 33#include <kapplication.h>
27#include <kdebug.h> 34#include <kdebug.h>
28#include <kconfig.h> 35#include <kconfig.h>
29#include <kstandarddirs.h> 36#include <kstandarddirs.h>
@@ -31,14 +38,14 @@
31#include "resource.h" 38#include "resource.h"
32#include "factory.h" 39#include "factory.h"
33#include "managerimpl.h" 40#include "managerimpl.h"
34 41
35using namespace KRES; 42using namespace KRES;
36 43
37ManagerImpl::ManagerImpl( const QString &family ) 44ManagerImpl::ManagerImpl( const QString &family, bool syncable )
38 : mFamily( family ), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ), 45 : mFamily( family ), mSyncable(syncable), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ),
39 mFactory( 0 ) 46 mFactory( 0 )
40 47
41{ 48{
42 kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl; 49 kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl;
43 50
44 51
@@ -258,13 +265,13 @@ Resource* ManagerImpl::readResourceConfig( const QString& identifier,
258 // such that gourp info not avail on win32 plugins 265 // such that gourp info not avail on win32 plugins
259 // to fix that, it would be a looooot of work 266 // to fix that, it would be a looooot of work
260 mConfig->setTempGroup( "Resource_" + identifier ); 267 mConfig->setTempGroup( "Resource_" + identifier );
261#endif 268#endif
262 QString type = mConfig->readEntry( "ResourceType" ); 269 QString type = mConfig->readEntry( "ResourceType" );
263 QString name = mConfig->readEntry( "ResourceName" ); 270 QString name = mConfig->readEntry( "ResourceName" );
264 Resource *resource = mFactory->resource( type, mConfig ); 271 Resource *resource = mFactory->resource( type, mConfig, mSyncable );
265 if ( !resource ) { 272 if ( !resource ) {
266 qDebug("Failed to create resource with id %s ",identifier.latin1() ); 273 qDebug("Failed to create resource with id %s ",identifier.latin1() );
267 return 0; 274 return 0;
268 } 275 }
269 276
270 if ( resource->identifier().isEmpty() ) 277 if ( resource->identifier().isEmpty() )
@@ -353,6 +360,15 @@ Resource* ManagerImpl::getResource( const QString& identifier )
353 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 360 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
354 if ( (*it)->identifier() == identifier ) 361 if ( (*it)->identifier() == identifier )
355 return *it; 362 return *it;
356 } 363 }
357 return 0; 364 return 0;
358} 365}
366
367/**
368 Return true, if the manager manages syncable resources.
369*/
370bool ManagerImpl::manageSyncable() const
371{
372 return mSyncable;
373}
374