author | zecke <zecke> | 2004-05-29 18:43:13 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-05-29 18:43:13 (UTC) |
commit | 43c1ce80bc5faf16fe9d86c4685512659f5180bc (patch) (side-by-side diff) | |
tree | ebd64b019954d702a39bad96d3324bbe79d7f9b6 | |
parent | f568ff9c68bdc61cbc4482f9b2c6e1096cecaae0 (diff) | |
download | opie-43c1ce80bc5faf16fe9d86c4685512659f5180bc.zip opie-43c1ce80bc5faf16fe9d86c4685512659f5180bc.tar.gz opie-43c1ce80bc5faf16fe9d86c4685512659f5180bc.tar.bz2 |
Make Enabled/Disabled work.
Problem was /home/ich/foo//plugins/foo
where /home/ich/foo/ was OPIEDIR and we added /
-rw-r--r-- | libopie2/opiecore/opluginloader.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libopie2/opiecore/opluginloader.cpp b/libopie2/opiecore/opluginloader.cpp index 3d286e5..e7eddc2 100644 --- a/libopie2/opiecore/opluginloader.cpp +++ b/libopie2/opiecore/opluginloader.cpp @@ -252,65 +252,65 @@ void OPluginItem::setPosition( int pos ) { /** * \brief create a PluginLoader * * Create a PluginLoader autoDelete is set to false * * \code * Opie::Core::OGenericPluginLoader loader("myapp-plugin"); * Opie::Core::OPluginItem::List lst = loader.filtered(); * for(Opie::Core::OPluginItem::List::Iterator it = lst.begin(); it!=lst.end();++it){ * MyIface* iface = static_cast<MyIface*>(loader.load(*it,IID_MyIface)); * } * \endcode * * \code * Opie::Core::OGenericPluginLoader loader("myapp-plugin"); * Opie::Core::OPluginItem::List lst = loader.filtered(); * for(Opie::Core::OPluginItem::List::Iterator it = lst.begin(); it!=lst.end();++it){ * MyIface* iface = static_cast<MyIface*>(loader.load(*it,IID_MyIface)); * } * ... * loader.clear(); * * \endcode * * @param name The name of the plugin directory. * @param isSorted Tell the PluginLoader if your Plugins are sorted */ OGenericPluginLoader::OGenericPluginLoader( const QString& name, bool isSorted) : m_dir( name ), m_autoDelete( false ), m_isSafeMode( false ), m_isSorted( isSorted ) { - setPluginDir( QPEApplication::qpeDir() + "/plugins/"+name ); + setPluginDir( QPEApplication::qpeDir() + "plugins/"+name ); readConfig(); } /** * \brief simple d'tor that cleans up depending on autoDelete * * calls clear if autoDelete is true. This will release all interfaces * and remove the library from this process if the refcount falls to zero */ OGenericPluginLoader::~OGenericPluginLoader() { if ( m_autoDelete ) clear(); } /** * \brief Enable or disable autoDelete on destruction * * enable autoDelete. This will call clear on the d'tor * * @see ~OGenericPluginLoader * @see clear() */ void OGenericPluginLoader::setAutoDelete( bool t ) { m_autoDelete = t; } /** * \brief See if autoDelete is enabled. */ bool OGenericPluginLoader::autoDelete()const{ return m_autoDelete; @@ -504,64 +504,65 @@ bool OGenericPluginLoader::isSorted()const{ */ /** * @internal */ QString OGenericPluginLoader::unlibify( const QString& str ) { QString st = str.mid( str.find( "lib" )+3 ); #ifdef Q_OS_MACX return st.left( st.findRev( ".dylib" ) ); #else return st.left( st.findRev( ".so" ) ); #endif } /** * @internal * * \brief method to return available plugins. Internal and for reeimplementations * *Return a List of Plugins for a dir and add positions and remove disabled. * If a plugin is on the excluded list assign position -2 * * @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" ); 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(); |