author | zecke <zecke> | 2004-05-28 22:49:15 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-28 22:49:15 (UTC) |
commit | 08998f34ec77062224dc0783be78d9e6e3bf7910 (patch) (side-by-side diff) | |
tree | ef7855f9ead12b408e9b4b3ca7f6f8f58466016f /libopie2 | |
parent | e15f3bb9f0a652076050ddcfb0c31a16ae845373 (diff) | |
download | opie-08998f34ec77062224dc0783be78d9e6e3bf7910.zip opie-08998f34ec77062224dc0783be78d9e6e3bf7910.tar.gz opie-08998f34ec77062224dc0783be78d9e6e3bf7910.tar.bz2 |
Make harlekin happy. AkA uncomitted code
-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 @@ -562,13 +562,12 @@ 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 ); bool ex = excludedMap.contains( str ); /* @@ -669,13 +668,13 @@ OPluginLoader::~OPluginLoader() { * * * @param loader A Pointer to your OGenericPluginLoader * @param name The name */ OPluginManager::OPluginManager( OGenericPluginLoader* loader) - : m_loader( loader ) + : m_loader( loader ), m_isSorted( false ) { } /** * \brief Overloaded c'tor using a List of Plugins and a type name * Overloaded Constructor to work with a 'Type' of plugins @@ -868,11 +867,24 @@ 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 @@ -154,12 +154,13 @@ public: * * @see Opie::Ui::OPluginConfig * */ class OPluginManager { public: + typedef QValueList<OPluginManager*> List; OPluginManager( OGenericPluginLoader* ); OPluginManager( const QString& name, const OPluginItem::List&, bool isSorted = false ); virtual ~OPluginManager(); OPluginItem crashedPlugin()const; |