summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/manager.h
Side-by-side diff
Diffstat (limited to 'microkde/kresources/manager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/manager.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/microkde/kresources/manager.h b/microkde/kresources/manager.h
index 0e6f838..69062da 100644
--- a/microkde/kresources/manager.h
+++ b/microkde/kresources/manager.h
@@ -198,143 +198,141 @@ class Manager : private ManagerImplListener
Write configuration of Resource objects to configuration file. If cfg is 0, write
to standard configuration file.
*/
void writeConfig( KConfig *cfg = 0 )
{
mImpl->writeConfig( cfg );
}
/**
Add resource to manager. This passes ownership of the Resource object
to the manager.
*/
void add( Resource *resource )
{
if ( resource ) mImpl->add( resource );
}
void remove( Resource *resource )
{
if ( resource ) mImpl->remove( resource );
}
T* standardResource()
{
return static_cast<T *>( mImpl->standardResource() );
}
void setStandardResource( T *resource )
{
if ( resource ) mImpl->setStandardResource( resource );
}
void setActive( Resource *resource, bool active )
{
if ( resource ) mImpl->setActive( resource, active );
}
/**
Returns a list of the names of the reources managed by the
Manager for this family.
*/
QStringList resourceNames() const
{
return mImpl->resourceNames();
}
ConfigWidget *configWidget( const QString& type, QWidget *parent = 0 )
{
- return mFactory->resourceConfigWidget( type, parent );
+ return mFactory->configWidget( type, parent );
}
/**
Creates a new resource of type @param type, with default
settings. The resource is
not added to the manager, the application has to do that.
Returns a pointer to a resource object or a null pointer
if resource type doesn't exist.
@param type The type of the resource, one of those returned
by @ref resourceTypeNames()
*/
T *createResource( const QString& type )
{
return (T *)( mFactory->resource( type, 0 ) );
}
/**
Returns a list of the names of all available resource types.
*/
QStringList resourceTypeNames() const
{
return mFactory->typeNames();
}
QStringList resourceTypeDescriptions() const
{
QStringList typeDescs;
QStringList types = mFactory->typeNames();
for ( QStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) {
QString desc = mFactory->typeName( *it );
if ( !mFactory->typeDescription( *it ).isEmpty() )
desc += " (" + mFactory->typeDescription( *it ) + ")";
typeDescs.append( desc );
}
return typeDescs;
}
void resourceChanged( T *resource )
{
mImpl->resourceChanged( resource );
}
void addListener( ManagerListener<T> *listener )
{
mListeners->append( listener );
}
void removeListener( ManagerListener<T> *listener )
{
mListeners->remove( listener );
}
virtual void resourceAdded( Resource *res )
{
- kdDebug(5650) << "Manager::resourceAdded " << res->resourceName() << endl;
T* resource = (T *)( res );
ManagerListener<T> *listener;
for ( listener = mListeners->first(); listener; listener = mListeners->next() )
listener->resourceAdded( resource );
}
virtual void resourceModified( Resource *res )
{
- kdDebug(5650) << "Manager::resourceModified " << res->resourceName() << endl;
+
T* resource = (T *)( res );
ManagerListener<T> *listener;
for ( listener = mListeners->first(); listener; listener = mListeners->next() )
listener->resourceModified( resource );
}
virtual void resourceDeleted( Resource *res )
{
- kdDebug(5650) << "Manager::resourceDeleted " << res->resourceName() << endl;
+
T* resource = (T *)( res );
ManagerListener<T> *listener;
for ( listener = mListeners->first(); listener; listener = mListeners->next() ) {
- kdDebug(5650) << "Notifying a listener to Manager..." << endl;
listener->resourceDeleted( resource );
}
}
private:
ManagerImpl *mImpl;
Factory *mFactory;
QPtrList<ManagerListener<T> > *mListeners;
};
}
#endif