summaryrefslogtreecommitdiff
path: root/libopie2/examples/opiecore
authorzecke <zecke>2004-05-11 21:58:26 (UTC)
committer zecke <zecke>2004-05-11 21:58:26 (UTC)
commit81104f00cb87962333a024d3fa5ff6cf3d8d7d83 (patch) (unidiff)
treea2cf80b7c2a340e7e24692ced55155e2e907cf77 /libopie2/examples/opiecore
parente58a9f83f1bd385aad687daa166077602e921494 (diff)
downloadopie-81104f00cb87962333a024d3fa5ff6cf3d8d7d83.zip
opie-81104f00cb87962333a024d3fa5ff6cf3d8d7d83.tar.gz
opie-81104f00cb87962333a024d3fa5ff6cf3d8d7d83.tar.bz2
-Woot The OpluginLoader successfully loaded and unloaded the Today Plugins
-Now when GUI and manager is done I'll see if sorting and disabling also works No leak, no memcorruption when running the test case
Diffstat (limited to 'libopie2/examples/opiecore') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opiecore/oplugins/oplugins.cpp37
-rw-r--r--libopie2/examples/opiecore/oplugins/oplugins.pro11
2 files changed, 48 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}
diff --git a/libopie2/examples/opiecore/oplugins/oplugins.pro b/libopie2/examples/opiecore/oplugins/oplugins.pro
new file mode 100644
index 0000000..7286de9
--- a/dev/null
+++ b/libopie2/examples/opiecore/oplugins/oplugins.pro
@@ -0,0 +1,11 @@
1TEMPLATE = app
2CONFIG += qt warn_on
3
4SOURCES = oplugins.cpp
5
6INCLUDEPATH += $(OPIEDIR)/include
7DEPENDSPATH += $(OPIEDIR)/include
8
9LIBS += -lopiecore2
10
11include ( $(OPIEDIR)/include.pro )