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.cpp13
1 files changed, 3 insertions, 10 deletions
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
@@ -32,26 +32,26 @@ $Id$
32 32
33#include <kapplication.h> 33#include <kapplication.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kconfig.h> 35#include <kconfig.h>
36#include <kstandarddirs.h> 36#include <kstandarddirs.h>
37 37
38#include "resource.h" 38#include "resource.h"
39#include "factory.h" 39#include "factory.h"
40#include "managerimpl.h" 40#include "managerimpl.h"
41 41
42using namespace KRES; 42using namespace KRES;
43 43
44ManagerImpl::ManagerImpl( const QString &family, bool syncable ) 44ManagerImpl::ManagerImpl( const QString &family )
45 : mFamily( family ), mSyncable(syncable), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ), 45 : mFamily( family ), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ),
46 mFactory( 0 ) 46 mFactory( 0 )
47 47
48{ 48{
49 kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl; 49 kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl;
50 50
51 51
52} 52}
53 53
54ManagerImpl::~ManagerImpl() 54ManagerImpl::~ManagerImpl()
55{ 55{
56 kdDebug(5650) << "ManagerImpl::~ManagerImpl()" << endl; 56 kdDebug(5650) << "ManagerImpl::~ManagerImpl()" << endl;
57 57
@@ -259,25 +259,25 @@ Resource* ManagerImpl::readResourceConfig( const QString& identifier,
259 259
260// qDebug("ManagerImpl::readResourceConfig() %s", identifier.latin1()); 260// qDebug("ManagerImpl::readResourceConfig() %s", identifier.latin1());
261 261
262 mConfig->setGroup( "Resource_" + identifier ); 262 mConfig->setGroup( "Resource_" + identifier );
263#ifdef _WIN32_ 263#ifdef _WIN32_
264 // we use plugins on win32. the group is stored in a static variable 264 // we use plugins on win32. the group is stored in a static variable
265 // such that gourp info not avail on win32 plugins 265 // such that gourp info not avail on win32 plugins
266 // to fix that, it would be a looooot of work 266 // to fix that, it would be a looooot of work
267 mConfig->setTempGroup( "Resource_" + identifier ); 267 mConfig->setTempGroup( "Resource_" + identifier );
268#endif 268#endif
269 QString type = mConfig->readEntry( "ResourceType" ); 269 QString type = mConfig->readEntry( "ResourceType" );
270 QString name = mConfig->readEntry( "ResourceName" ); 270 QString name = mConfig->readEntry( "ResourceName" );
271 Resource *resource = mFactory->resource( type, mConfig, mSyncable ); 271 Resource *resource = mFactory->resource( type, mConfig );
272 if ( !resource ) { 272 if ( !resource ) {
273 qDebug("Failed to create resource with id %s ",identifier.latin1() ); 273 qDebug("Failed to create resource with id %s ",identifier.latin1() );
274 return 0; 274 return 0;
275 } 275 }
276 276
277 if ( resource->identifier().isEmpty() ) 277 if ( resource->identifier().isEmpty() )
278 resource->setIdentifier( identifier ); 278 resource->setIdentifier( identifier );
279 279
280 mConfig->setGroup( "General" ); 280 mConfig->setGroup( "General" );
281 281
282 QString standardKey = mConfig->readEntry( "Standard" ); 282 QString standardKey = mConfig->readEntry( "Standard" );
283 if ( standardKey == identifier ) { 283 if ( standardKey == identifier ) {
@@ -355,20 +355,13 @@ void ManagerImpl::removeResource( Resource *resource )
355} 355}
356 356
357Resource* ManagerImpl::getResource( const QString& identifier ) 357Resource* ManagerImpl::getResource( const QString& identifier )
358{ 358{
359 Resource::List::ConstIterator it; 359 Resource::List::ConstIterator it;
360 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 360 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
361 if ( (*it)->identifier() == identifier ) 361 if ( (*it)->identifier() == identifier )
362 return *it; 362 return *it;
363 } 363 }
364 return 0; 364 return 0;
365} 365}
366 366
367/**
368 Return true, if the manager manages syncable resources.
369*/
370bool ManagerImpl::manageSyncable() const
371{
372 return mSyncable;
373}
374 367