summaryrefslogtreecommitdiff
path: root/libopie2/examples/opiecore/oplugins/oplugins.cpp
Unidiff
Diffstat (limited to 'libopie2/examples/opiecore/oplugins/oplugins.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opiecore/oplugins/oplugins.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/libopie2/examples/opiecore/oplugins/oplugins.cpp b/libopie2/examples/opiecore/oplugins/oplugins.cpp
new file mode 100644
index 0000000..4aa2da5
--- a/dev/null
+++ b/libopie2/examples/opiecore/oplugins/oplugins.cpp
@@ -0,0 +1,37 @@
1/*
2 * You may copy, modify and or distribute without any limitation
3 */
4#include <opie2/odebug.h>
5#include <opie2/opluginloader.h>
6
7#include <opie2/todayplugininterface.h>
8
9using Opie::Core::OPluginItem;
10using Opie::Core::OGenericPluginLoader;
11
12void debugLst( const OPluginItem::List& lst ) {
13 for ( OPluginItem::List::ConstIterator it = lst.begin(); it != lst.end(); ++it )
14 odebug << "Name " << (*it).name() << " " << (*it).path() << " " << (*it).position() << oendl;
15}
16
17
18int main( void ) {
19 OGenericPluginLoader loader( "today", true );
20 loader.setAutoDelete( true );
21
22 odebug << "IS in Safe Mode" << loader.isInSafeMode() << oendl;
23
24 OPluginItem::List lst = loader.allAvailable( true );
25 debugLst( lst );
26
27 lst = loader.filtered( true );
28 debugLst( lst );
29
30 for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) {
31 QUnknownInterface* iface = loader.load( *it, IID_TodayPluginInterface );
32 }
33
34 /*
35 * now it's autodelete so cleaned up for us
36 */
37}