author | zecke <zecke> | 2004-05-28 22:49:15 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-28 22:49:15 (UTC) |
commit | 08998f34ec77062224dc0783be78d9e6e3bf7910 (patch) (unidiff) | |
tree | ef7855f9ead12b408e9b4b3ca7f6f8f58466016f | |
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 | |||
@@ -565,7 +565,6 @@ OPluginItem::List OGenericPluginLoader::plugins( const QString& _dir, bool sorte | |||
565 | 565 | ||
566 | 566 | ||
567 | QStringList list = dir.entryList(); | 567 | QStringList list = dir.entryList(); |
568 | QStringList::Iterator it; | ||
569 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 568 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
570 | QString str = unlibify( *it ); | 569 | QString str = unlibify( *it ); |
571 | OPluginItem item( str, _dir + "/" + *it ); | 570 | OPluginItem item( str, _dir + "/" + *it ); |
@@ -672,7 +671,7 @@ OPluginLoader::~OPluginLoader() { | |||
672 | * @param name The name | 671 | * @param name The name |
673 | */ | 672 | */ |
674 | OPluginManager::OPluginManager( OGenericPluginLoader* loader) | 673 | OPluginManager::OPluginManager( OGenericPluginLoader* loader) |
675 | : m_loader( loader ) | 674 | : m_loader( loader ), m_isSorted( false ) |
676 | { | 675 | { |
677 | } | 676 | } |
678 | 677 | ||
@@ -871,7 +870,20 @@ QString OPluginManager::configName()const { | |||
871 | * @internal.. replace in m_plugins by path... this is linear search O(n/2) | 870 | * @internal.. replace in m_plugins by path... this is linear search O(n/2) |
872 | */ | 871 | */ |
873 | void OPluginManager::replace( const OPluginItem& item ) { | 872 | void OPluginManager::replace( const OPluginItem& item ) { |
874 | // ### fixme | 873 | OPluginItem _item; |
874 | |||
875 | /* for all plugins */ | ||
876 | for ( OPluginItem::List::Iterator it=m_plugins.begin();it != m_plugins.end(); ++it ) { | ||
877 | _item = *it; | ||
878 | /* if path and name are the same we will remove, readd and return */ | ||
879 | if ( _item.path() == item.path() && | ||
880 | _item.name() == item.name() ) { | ||
881 | it = m_plugins.remove( it ); | ||
882 | m_plugins.append( item ); | ||
883 | return; | ||
884 | } | ||
885 | |||
886 | } | ||
875 | } | 887 | } |
876 | 888 | ||
877 | } | 889 | } |
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: | |||
157 | */ | 157 | */ |
158 | class OPluginManager { | 158 | class OPluginManager { |
159 | public: | 159 | public: |
160 | typedef QValueList<OPluginManager*> List; | ||
160 | OPluginManager( OGenericPluginLoader* ); | 161 | OPluginManager( OGenericPluginLoader* ); |
161 | OPluginManager( const QString& name, const OPluginItem::List&, bool isSorted = false ); | 162 | OPluginManager( const QString& name, const OPluginItem::List&, bool isSorted = false ); |
162 | virtual ~OPluginManager(); | 163 | virtual ~OPluginManager(); |