summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/managerimpl.cpp
Unidiff
Diffstat (limited to 'microkde/kresources/managerimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/managerimpl.cpp70
1 files changed, 43 insertions, 27 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
@@ -2,3 +2,3 @@
2 This file is part of libkresources. 2 This file is part of libkresources.
3 3
4 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 4 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
@@ -23,2 +23,9 @@
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>
@@ -36,4 +43,4 @@ using 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 )
@@ -42,4 +49,4 @@ ManagerImpl::ManagerImpl( const QString &family )
42 kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl; 49 kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl;
43 50
44 51
45} 52}
@@ -54,3 +61,3 @@ ManagerImpl::~ManagerImpl()
54 } 61 }
55 62
56 delete mStdConfig; 63 delete mStdConfig;
@@ -61,3 +68,3 @@ void ManagerImpl::createStandardConfig()
61 if ( !mStdConfig ) { 68 if ( !mStdConfig ) {
62 QString file = locateLocal( "data", KGlobal::getAppName() 69 QString file = locateLocal( "data", KGlobal::getAppName()
63 + "/kresources/" + mFamily + "rc" ); 70 + "/kresources/" + mFamily + "rc" );
@@ -65,3 +72,3 @@ void ManagerImpl::createStandardConfig()
65 } 72 }
66 73
67 mConfig = mStdConfig; 74 mConfig = mStdConfig;
@@ -81,3 +88,3 @@ void ManagerImpl::readConfig( KConfig *cfg )
81 } 88 }
82 89
83 mStandard = 0; 90 mStandard = 0;
@@ -94,3 +101,3 @@ void ManagerImpl::readConfig( KConfig *cfg )
94 } 101 }
95 102
96} 103}
@@ -99,5 +106,5 @@ void ManagerImpl::writeConfig( KConfig *cfg )
99{ 106{
100//USqDebug("ManagerImpl::writeConfig begin this= %ul cfg=%ul", this, cfg); 107//USqDebug("ManagerImpl::writeConfig begin this= %ul cfg=%ul", this, cfg);
101 108
102 109
103 kdDebug(5650) << "ManagerImpl::writeConfig()" << endl; 110 kdDebug(5650) << "ManagerImpl::writeConfig()" << endl;
@@ -109,3 +116,3 @@ void ManagerImpl::writeConfig( KConfig *cfg )
109 } 116 }
110 117
111 QStringList activeKeys; 118 QStringList activeKeys;
@@ -131,3 +138,3 @@ void ManagerImpl::writeConfig( KConfig *cfg )
131 mConfig->writeEntry( "PassiveResourceKeys", passiveKeys ); 138 mConfig->writeEntry( "PassiveResourceKeys", passiveKeys );
132 if ( mStandard ) 139 if ( mStandard )
133 mConfig->writeEntry( "Standard", mStandard->identifier() ); 140 mConfig->writeEntry( "Standard", mStandard->identifier() );
@@ -138,5 +145,5 @@ void ManagerImpl::writeConfig( KConfig *cfg )
138 kdDebug(5650) << "ManagerImpl::save() finished" << endl; 145 kdDebug(5650) << "ManagerImpl::save() finished" << endl;
139 146
140//US qDebug("ManagerImpl::writeConfig end this= %ul cfg=%ul", this, cfg); 147//US qDebug("ManagerImpl::writeConfig end this= %ul cfg=%ul", this, cfg);
141 148
142} 149}
@@ -145,4 +152,4 @@ void ManagerImpl::add( Resource *resource, bool useDCOP )
145{ 152{
146qDebug("ManagerImpl::add begin this= %ul resource=%ul", this, resource); 153qDebug("ManagerImpl::add begin this= %ul resource=%ul", this, resource);
147 154
148 resource->setActive( true ); 155 resource->setActive( true );
@@ -157,3 +164,3 @@ qDebug("ManagerImpl::add begin this= %ul resource=%ul", this, resource);
157 164
158 qDebug("ManagerImpl::add end this= %ul resource=%ul", this, resource); 165 qDebug("ManagerImpl::add end this= %ul resource=%ul", this, resource);
159 166
@@ -180,3 +187,3 @@ void ManagerImpl::setActive( Resource *resource, bool active )
180 187
181Resource *ManagerImpl::standardResource() 188Resource *ManagerImpl::standardResource()
182{ 189{
@@ -185,3 +192,3 @@ Resource *ManagerImpl::standardResource()
185 192
186void ManagerImpl::setStandardResource( Resource *resource ) 193void ManagerImpl::setStandardResource( Resource *resource )
187{ 194{
@@ -251,3 +258,3 @@ Resource* ManagerImpl::readResourceConfig( const QString& identifier,
251 kdDebug() << "ManagerImpl::readResourceConfig() " << identifier << endl; 258 kdDebug() << "ManagerImpl::readResourceConfig() " << identifier << endl;
252 259
253// qDebug("ManagerImpl::readResourceConfig() %s", identifier.latin1()); 260// qDebug("ManagerImpl::readResourceConfig() %s", identifier.latin1());
@@ -263,3 +270,3 @@ Resource* ManagerImpl::readResourceConfig( const QString& identifier,
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 ) {
@@ -307,3 +314,3 @@ void ManagerImpl::writeResourceConfig( Resource *resource,
307 mConfig->writeEntry( "Standard", "" ); 314 mConfig->writeEntry( "Standard", "" );
308 315
309 if ( checkActive ) { 316 if ( checkActive ) {
@@ -327,3 +334,3 @@ void ManagerImpl::removeResource( Resource *resource )
327 if ( !mConfig ) createStandardConfig(); 334 if ( !mConfig ) createStandardConfig();
328 335
329 mConfig->setGroup( "General" ); 336 mConfig->setGroup( "General" );
@@ -358 +365,10 @@ Resource* ManagerImpl::getResource( const QString& identifier )
358} 365}
366
367/**
368 Return true, if the manager manages syncable resources.
369*/
370bool ManagerImpl::manageSyncable() const
371{
372 return mSyncable;
373}
374