summaryrefslogtreecommitdiffabout
path: root/libkabcwrap/koaddresspluginloader.cpp
authorulf69 <ulf69>2004-08-06 18:30:46 (UTC)
committer ulf69 <ulf69>2004-08-06 18:30:46 (UTC)
commit8d905d7489f50210afde611138245ae2ee180f8f (patch) (unidiff)
tree27ef58359afe49e2e4e35734cf8fbe679cd6ed9c /libkabcwrap/koaddresspluginloader.cpp
parent555e6179368fb2446c802041a01db4c9dad7db8f (diff)
downloadkdepimpi-8d905d7489f50210afde611138245ae2ee180f8f.zip
kdepimpi-8d905d7489f50210afde611138245ae2ee180f8f.tar.gz
kdepimpi-8d905d7489f50210afde611138245ae2ee180f8f.tar.bz2
functionality now implemented in kabc resource plugins
Diffstat (limited to 'libkabcwrap/koaddresspluginloader.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkabcwrap/koaddresspluginloader.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/libkabcwrap/koaddresspluginloader.cpp b/libkabcwrap/koaddresspluginloader.cpp
deleted file mode 100644
index d329262..0000000
--- a/libkabcwrap/koaddresspluginloader.cpp
+++ b/dev/null
@@ -1,56 +0,0 @@
1#include <stdio.h>
2#include <qtopia/qlibrary.h>
3#include <qpe/qpeapplication.h>
4#include "koaddressbookpluginloader.h"
5#include "kabcaddressbookplugin.h"
6
7KOAddressBookInterface *KOAddressBookPluginLoader::iface = 0;
8KABC::Addressee::List KOAddressBookPluginLoader::addresseeList;
9
10KOAddressBookInterface *KOAddressBookPluginLoader::getInterface() {
11
12 qDebug("Start: KOAddressBookPluginLoader::getInterface");
13
14 if (!iface) {
15
16 const QString & qpeDir = QPEApplication::qpeDir();
17 QLibrary *lib = new QLibrary( qpeDir + "/plugins/korganizer/libopiekabc.so", QLibrary::Immediately );
18 QRESULT q = lib->queryInterface( IID_QUnknown, (QUnknownInterface**)&iface );
19 if ( q != QS_OK ) {
20 lib = new QLibrary( qpeDir + "/plugins/korganizer/libqtopiakabc.so", QLibrary::Immediately );
21 QRESULT q = lib->queryInterface( IID_QUnknown, (QUnknownInterface**)&iface );
22 // we checked now for all known external interfaces. If no were found, use the default KABC interface
23 if ( q != QS_OK ) {
24 iface = new KABCAddressBookPlugin();
25 }
26 }
27 }
28
29 qDebug("End: KOAddressBookPluginLoader::getInterface");
30 return iface;
31
32}
33
34KABC::Addressee::List KOAddressBookPluginLoader::getAddresseesFromPlugin() {
35
36 qDebug("Start: KOAddressBookPluginLoader::getAddresseesFromPlugin");
37 addresseeList.clear();
38 if (!(addresseeList.count() > 0)) {
39 qDebug("KOAddressBookPluginLoader::getAddresseesFromPlugin: no addresses loaded. Loading...");
40 if (!iface) {
41 qDebug("KOAddressBookPluginLoader::getAddresseesFromPlugin: no interface loaded. Loading...");
42 iface = getInterface();
43 }
44 if (iface) {
45 qDebug("KOAddressBookPluginLoader::getAddresseesFromPlugin: interface is " + iface->name());
46 addresseeList = iface->getAddressees();
47 } else {
48 qDebug("KOAddressBookPluginLoader::getAddresseesFromPlugin: No interface found!");
49 }
50 }
51
52
53 qDebug("End: KOAddressBookPluginLoader::getAddresseesFromPlugin");
54 return addresseeList;
55
56}