From 08998f34ec77062224dc0783be78d9e6e3bf7910 Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 28 May 2004 22:49:15 +0000 Subject: Make harlekin happy. AkA uncomitted code --- (limited to 'libopie2') 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 @@ -565,7 +565,6 @@ 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 ) { QString str = unlibify( *it ); OPluginItem item( str, _dir + "/" + *it ); @@ -672,7 +671,7 @@ OPluginLoader::~OPluginLoader() { * @param name The name */ OPluginManager::OPluginManager( OGenericPluginLoader* loader) - : m_loader( loader ) + : m_loader( loader ), m_isSorted( false ) { } @@ -871,7 +870,20 @@ QString OPluginManager::configName()const { * @internal.. replace in m_plugins by path... this is linear search O(n/2) */ 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 @@ -157,6 +157,7 @@ public: */ class OPluginManager { public: + typedef QValueList List; OPluginManager( OGenericPluginLoader* ); OPluginManager( const QString& name, const OPluginItem::List&, bool isSorted = false ); virtual ~OPluginManager(); -- cgit v0.9.0.2