-rw-r--r-- | microkde/kresources/managerimpl.cpp | 11 | ||||
-rw-r--r-- | microkde/kresources/resource.cpp | 7 |
2 files changed, 15 insertions, 3 deletions
diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp index 1baa6be..785b6b4 100644 --- a/microkde/kresources/managerimpl.cpp +++ b/microkde/kresources/managerimpl.cpp @@ -232,55 +232,60 @@ QPtrList<Resource> ManagerImpl::resources( bool active ) QPtrList<Resource> result; Resource::List::ConstIterator it; for ( it = mResources.begin(); it != mResources.end(); ++it ) { if ( (*it)->isActive() == active ) { result.append( *it ); } } 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 ); if ( !resource ) { - kdDebug(5650) << "Failed to create resource with id " << identifier << endl; - return 0; + 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; } void ManagerImpl::writeResourceConfig( Resource *resource, bool checkActive ) { diff --git a/microkde/kresources/resource.cpp b/microkde/kresources/resource.cpp index 7827a67..991d53d 100644 --- a/microkde/kresources/resource.cpp +++ b/microkde/kresources/resource.cpp @@ -32,48 +32,55 @@ using namespace KRES; class Resource::ResourcePrivate { public: #ifdef QT_THREAD_SUPPORT QMutex mMutex; #endif int mOpenCount; QString mType; QString mIdentifier; bool mReadOnly; QString mName; bool mActive; bool mIsOpen; }; Resource::Resource( const KConfig* config ) : QObject( 0, "" ), d( new ResourcePrivate ) { d->mOpenCount = 0; d->mIsOpen = false; //US compiler claimed that const discards qualifier KConfig* cfg = (KConfig*)config; if ( cfg ) { +#ifdef _WIN32_ + // we use plugins on win32. the group is stored in a static variable + // such that group info not available on win32 plugins + // to fix that, it would be a looooot of work + if ( !cfg->tempGroup().isEmpty() ) + cfg->setGroup( cfg->tempGroup() ); +#endif d->mType = cfg->readEntry( "ResourceType" ); d->mName = cfg->readEntry( "ResourceName" ); d->mReadOnly = cfg->readBoolEntry( "ResourceIsReadOnly", false ); d->mActive = cfg->readBoolEntry( "ResourceIsActive", true ); d->mIdentifier = cfg->readEntry( "ResourceIdentifier" ); } else { d->mType = "type"; d->mName = "resource-name"; d->mReadOnly = false; d->mActive = true; d->mIdentifier = KApplication::randomString( 10 ); } } Resource::~Resource() { delete d; d = 0; } void Resource::writeConfig( KConfig* config ) { |