summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/managerimpl.cpp
Side-by-side diff
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
@@ -20,50 +20,50 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#include <kglobal.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kstandarddirs.h>
#include "resource.h"
#include "factory.h"
#include "managerimpl.h"
using namespace KRES;
-ManagerImpl::ManagerImpl( const QString &family, bool syncable )
- : mFamily( family ), mSyncable(syncable), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ),
+ManagerImpl::ManagerImpl( const QString &family )
+ : mFamily( family ), mConfig( 0 ), mStdConfig( 0 ), mStandard( 0 ),
mFactory( 0 )
{
kdDebug(5650) << "ManagerImpl::ManagerImpl()" << endl;
}
ManagerImpl::~ManagerImpl()
{
kdDebug(5650) << "ManagerImpl::~ManagerImpl()" << endl;
Resource::List::ConstIterator it;
for ( it = mResources.begin(); it != mResources.end(); ++it ) {
delete *it;
}
delete mStdConfig;
}
void ManagerImpl::createStandardConfig()
{
if ( !mStdConfig ) {
QString file = locateLocal( "data", KGlobal::getAppName()
@@ -247,49 +247,49 @@ QPtrList<Resource> ManagerImpl::resources( bool active )
return result;
}
void ManagerImpl::setListener( ManagerImplListener *listener )
{
mListener = listener;
}
Resource* ManagerImpl::readResourceConfig( const QString& identifier,
bool checkActive )
{
kdDebug() << "ManagerImpl::readResourceConfig() " << identifier << endl;
// qDebug("ManagerImpl::readResourceConfig() %s", identifier.latin1());
mConfig->setGroup( "Resource_" + identifier );
#ifdef _WIN32_
// we use plugins on win32. the group is stored in a static variable
// such that gourp info not avail on win32 plugins
// to fix that, it would be a looooot of work
mConfig->setTempGroup( "Resource_" + identifier );
#endif
QString type = mConfig->readEntry( "ResourceType" );
QString name = mConfig->readEntry( "ResourceName" );
- Resource *resource = mFactory->resource( type, mConfig, mSyncable );
+ Resource *resource = mFactory->resource( type, mConfig );
if ( !resource ) {
qDebug("Failed to create resource with id %s ",identifier.latin1() );
return 0;
}
if ( resource->identifier().isEmpty() )
resource->setIdentifier( identifier );
mConfig->setGroup( "General" );
QString standardKey = mConfig->readEntry( "Standard" );
if ( standardKey == identifier ) {
mStandard = resource;
}
if ( checkActive ) {
QStringList activeKeys = mConfig->readListEntry( "ResourceKeys" );
resource->setActive( activeKeys.contains( identifier ) );
}
mResources.append( resource );
return resource;
}
@@ -343,32 +343,25 @@ void ManagerImpl::removeResource( Resource *resource )
passiveKeys.remove( key );
mConfig->writeEntry( "PassiveResourceKeys", passiveKeys );
}
QString standardKey = mConfig->readEntry( "Standard" );
if ( standardKey == key ) {
mConfig->writeEntry( "Standard", "" );
}
mConfig->deleteGroup( "Resource_" + resource->identifier() );
mConfig->sync();
}
Resource* ManagerImpl::getResource( const QString& identifier )
{
Resource::List::ConstIterator it;
for ( it = mResources.begin(); it != mResources.end(); ++it ) {
if ( (*it)->identifier() == identifier )
return *it;
}
return 0;
}
-/**
- Return true, if the manager manages syncable resources.
-*/
-bool ManagerImpl::manageSyncable() const
-{
- return mSyncable;
-}