-rw-r--r-- | libopie2/opiecore/opluginloader.cpp | 18 | ||||
-rw-r--r-- | libopie2/opiecore/opluginloader.h | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/libopie2/opiecore/opluginloader.cpp b/libopie2/opiecore/opluginloader.cpp index 2aca382..87e24d4 100644 --- a/libopie2/opiecore/opluginloader.cpp +++ b/libopie2/opiecore/opluginloader.cpp @@ -567,3 +567,2 @@ OPluginItem::List OGenericPluginLoader::plugins( const QString& _dir, bool sorte QStringList list = dir.entryList(); - QStringList::Iterator it; for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { @@ -674,3 +673,3 @@ OPluginLoader::~OPluginLoader() { OPluginManager::OPluginManager( OGenericPluginLoader* loader) - : m_loader( loader ) + : m_loader( loader ), m_isSorted( false ) { @@ -873,3 +872,16 @@ QString OPluginManager::configName()const { void OPluginManager::replace( const OPluginItem& item ) { -// ### fixme + OPluginItem _item; + + /* for all plugins */ + for ( OPluginItem::List::Iterator it=m_plugins.begin();it != m_plugins.end(); ++it ) { + _item = *it; + /* if path and name are the same we will remove, readd and return */ + if ( _item.path() == item.path() && + _item.name() == item.name() ) { + it = m_plugins.remove( it ); + m_plugins.append( item ); + return; + } + + } } diff --git a/libopie2/opiecore/opluginloader.h b/libopie2/opiecore/opluginloader.h index 2f9ec2a..740551c 100644 --- a/libopie2/opiecore/opluginloader.h +++ b/libopie2/opiecore/opluginloader.h @@ -159,2 +159,3 @@ class OPluginManager { public: + typedef QValueList<OPluginManager*> List; OPluginManager( OGenericPluginLoader* ); |