-rw-r--r-- | libopie2/opiecore/opluginloader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiecore/opluginloader.cpp b/libopie2/opiecore/opluginloader.cpp index 87e24d4..c2dc239 100644 --- a/libopie2/opiecore/opluginloader.cpp +++ b/libopie2/opiecore/opluginloader.cpp @@ -525,49 +525,49 @@ QString OGenericPluginLoader::unlibify( const QString& str ) { * @param dir The dir to look in * @param sorted Should positions be read? * @param disabled Remove excluded from the list */ OPluginItem::List OGenericPluginLoader::plugins( const QString& _dir, bool sorted, bool disabled )const { #ifdef Q_OS_MACX QDir dir( _dir, "lib*.dylib" ); #else QDir dir( _dir, "lib*.so" ); #endif OPluginItem::List lst; /* * get excluded list and then iterate over them * Excluded list contains the name * Position is a list with 'name.pos.name.pos.name.pos' * * For the look up we will create two QMap<QString,pos> */ QMap<QString, int> positionMap; QMap<QString, int> excludedMap; - OConfig cfg( m_dir+"odpplugins" ); + OConfig cfg( m_dir+"-odpplugins" ); cfg.setGroup( _dir ); QStringList excludes = cfg.readListEntry( "Excluded", ',' ); for ( QStringList::Iterator it = excludes.begin(); it != excludes.end(); ++it ) excludedMap.insert( *it, -2 ); if ( m_isSorted ) { QStringList pos = cfg.readListEntry( "Positions", '.' ); QStringList::Iterator it = pos.begin(); while ( it != pos.end() ) positionMap.insert( *it++, (*it++).toInt() ); } QStringList list = dir.entryList(); for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { QString str = unlibify( *it ); OPluginItem item( str, _dir + "/" + *it ); bool ex = excludedMap.contains( str ); /* @@ -842,49 +842,49 @@ void OPluginManager::save() { * Now safe for each path */ OConfig cfg( configName() ); /* safe excluded items */ for ( QMap<QString, QStringList>::Iterator it = excluded.begin(); it != excluded.end(); ++it ) { OConfigGroupSaver saver( &cfg, it.key() ); cfg.writeEntry("Excluded", it.data(), ',' ); } /* safe positions we could also see if positions.contains(path) and remove/write in the above loop * ### Write a Test Suite that can profile these runs... */ for ( QMap<QString, QStringList>::Iterator it = positions.begin(); it != positions.end(); ++it ) { OConfigGroupSaver saver( &cfg, it.key() ); cfg.writeEntry("Positions", it.data(), '.' ); } } /** * @internal */ QString OPluginManager::configName()const { QString str = m_loader ? m_loader->name() : m_cfgName; - return str + "odpplugins"; + return str + "-odpplugins"; } /** * @internal.. replace in m_plugins by path... this is linear search O(n/2) */ void OPluginManager::replace( const OPluginItem& item ) { 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; } } } } } |