author | zautrix <zautrix> | 2005-10-27 10:46:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-27 10:46:00 (UTC) |
commit | f2d8e3c646f689c3d7b91a987bddf4c1e7f268b8 (patch) (unidiff) | |
tree | 3b0647f6b8d5a411d33d128b7365c99d3cb52850 | |
parent | 29c7448b3c54e8d579732d10f144e12f7167c3c3 (diff) | |
download | kdepimpi-f2d8e3c646f689c3d7b91a987bddf4c1e7f268b8.zip kdepimpi-f2d8e3c646f689c3d7b91a987bddf4c1e7f268b8.tar.gz kdepimpi-f2d8e3c646f689c3d7b91a987bddf4c1e7f268b8.tar.bz2 |
commit
-rw-r--r-- | kabc/plugins/olaccess/olaccess.pro | 1 | ||||
-rw-r--r-- | kabc/plugins/olaccess/resourceolaccess.cpp | 5 | ||||
-rw-r--r-- | microkde/kresources/factory.cpp | 2 | ||||
-rw-r--r-- | variables.pri | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/kabc/plugins/olaccess/olaccess.pro b/kabc/plugins/olaccess/olaccess.pro index 4416d0c..9b95015 100644 --- a/kabc/plugins/olaccess/olaccess.pro +++ b/kabc/plugins/olaccess/olaccess.pro | |||
@@ -1,34 +1,35 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | TARGET = microkabc_olaccess | 3 | TARGET = microkabc_olaccess |
4 | 4 | ||
5 | include( ../../../variables.pri ) | 5 | include( ../../../variables.pri ) |
6 | 6 | ||
7 | INCLUDEPATH += ../../.. ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat | 7 | INCLUDEPATH += ../../.. ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat |
8 | 8 | ||
9 | INTERFACES = \ | 9 | INTERFACES = \ |
10 | 10 | ||
11 | DESTDIR = ../../../bin | ||
11 | HEADERS = \ | 12 | HEADERS = \ |
12 | resourceolaccess.h \ | 13 | resourceolaccess.h \ |
13 | resourceolaccessconfig.h \ | 14 | resourceolaccessconfig.h \ |
14 | olaccessconverter.h | 15 | olaccessconverter.h |
15 | 16 | ||
16 | SOURCES = \ | 17 | SOURCES = \ |
17 | resourceolaccess.cpp \ | 18 | resourceolaccess.cpp \ |
18 | resourceolaccessconfig.cpp \ | 19 | resourceolaccessconfig.cpp \ |
19 | olaccessconverter.cpp | 20 | olaccessconverter.cpp |
20 | 21 | ||
21 | unix : { | 22 | unix : { |
22 | OBJECTS_DIR = obj/unix | 23 | OBJECTS_DIR = obj/unix |
23 | MOC_DIR = moc/unix | 24 | MOC_DIR = moc/unix |
24 | } | 25 | } |
25 | win32: { | 26 | win32: { |
26 | CONFIG += dll | 27 | CONFIG += dll |
27 | DEFINES += _WIN32_ | 28 | DEFINES += _WIN32_ |
28 | OBJECTS_DIR = obj/win | 29 | OBJECTS_DIR = obj/win |
29 | MOC_DIR = moc/win | 30 | MOC_DIR = moc/win |
30 | LIBS += ../../../bin/microkdepim.lib | 31 | LIBS += ../../../bin/microkdepim.lib |
31 | LIBS += ../../../bin/microkcal.lib | 32 | LIBS += ../../../bin/microkcal.lib |
32 | LIBS += ../../../bin/microkde.lib | 33 | LIBS += ../../../bin/microkde.lib |
33 | LIBS += ../../../bin/microkabc.lib | 34 | LIBS += ../../../bin/microkabc.lib |
34 | } | 35 | } |
diff --git a/kabc/plugins/olaccess/resourceolaccess.cpp b/kabc/plugins/olaccess/resourceolaccess.cpp index 7113e0e..c7c9874 100644 --- a/kabc/plugins/olaccess/resourceolaccess.cpp +++ b/kabc/plugins/olaccess/resourceolaccess.cpp | |||
@@ -9,102 +9,103 @@ | |||
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <sys/types.h> | 28 | #include <sys/types.h> |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | 30 | ||
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qfile.h> | 32 | #include <qfile.h> |
33 | #include <qfileinfo.h> | 33 | #include <qfileinfo.h> |
34 | #include <qregexp.h> | 34 | #include <qregexp.h> |
35 | //US #include <qtimer.h> | 35 | //US #include <qtimer.h> |
36 | 36 | ||
37 | #include <kapplication.h> | 37 | #include <kapplication.h> |
38 | #include <kconfig.h> | 38 | #include <kconfig.h> |
39 | #include <kdebug.h> | 39 | #include <kdebug.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | //US #include <ksavefile.h> | 41 | //US #include <ksavefile.h> |
42 | #include <kstandarddirs.h> | 42 | #include <kstandarddirs.h> |
43 | #include <kmessagebox.h> | 43 | #include <kmessagebox.h> |
44 | 44 | ||
45 | 45 | ||
46 | #include <libkdepim/ksyncprofile.h> | 46 | #include <libkdepim/ksyncprofile.h> |
47 | 47 | ||
48 | #include "resourceolaccessconfig.h" | 48 | #include "resourceolaccessconfig.h" |
49 | #include "resourceolaccess.h" | 49 | #include "resourceolaccess.h" |
50 | 50 | ||
51 | #include "stdaddressbook.h" | 51 | #include "stdaddressbook.h" |
52 | 52 | ||
53 | #include "olaccessconverter.h" | 53 | #include "olaccessconverter.h" |
54 | //#define ALLOW_LOCKING | 54 | //#define ALLOW_LOCKING |
55 | using namespace KABC; | 55 | using namespace KABC; |
56 | extern "C" | 56 | extern "C" |
57 | { | 57 | __declspec(dllexport) |
58 | |||
58 | void *init_microkabc_olaccess() | 59 | void *init_microkabc_olaccess() |
59 | { | 60 | { |
60 | return new KRES::PluginFactory<Resourceolaccess,ResourceolaccessConfig>(); | 61 | return new KRES::PluginFactory<Resourceolaccess,ResourceolaccessConfig>(); |
61 | } | 62 | } |
62 | } | 63 | |
63 | 64 | ||
64 | Resourceolaccess::Resourceolaccess( const KConfig *config ) | 65 | Resourceolaccess::Resourceolaccess( const KConfig *config ) |
65 | : Resource( config ), mConverter (0) | 66 | : Resource( config ), mConverter (0) |
66 | { | 67 | { |
67 | // we can not choose the filename. Therefore use the default to display | 68 | // we can not choose the filename. Therefore use the default to display |
68 | //mAccess = 0; | 69 | //mAccess = 0; |
69 | QString fileName;// = SlZDataBase::addressbookFileName(); | 70 | QString fileName;// = SlZDataBase::addressbookFileName(); |
70 | init( fileName ); | 71 | init( fileName ); |
71 | } | 72 | } |
72 | 73 | ||
73 | Resourceolaccess::Resourceolaccess( const QString &fileName ) | 74 | Resourceolaccess::Resourceolaccess( const QString &fileName ) |
74 | : Resource( 0 ) | 75 | : Resource( 0 ) |
75 | { | 76 | { |
76 | //mAccess = 0; | 77 | //mAccess = 0; |
77 | init( fileName ); | 78 | init( fileName ); |
78 | } | 79 | } |
79 | 80 | ||
80 | void Resourceolaccess::init( const QString &fileName ) | 81 | void Resourceolaccess::init( const QString &fileName ) |
81 | { | 82 | { |
82 | if (mConverter == 0) { | 83 | if (mConverter == 0) { |
83 | mConverter = new OlaccessConverter(); | 84 | mConverter = new OlaccessConverter(); |
84 | bool res = mConverter->init(); | 85 | bool res = mConverter->init(); |
85 | if ( !res ) | 86 | if ( !res ) |
86 | { | 87 | { |
87 | QString msg("Unable to initialize sharp converter. Most likely a problem with the category file"); | 88 | QString msg("Unable to initialize sharp converter. Most likely a problem with the category file"); |
88 | qDebug(msg); | 89 | qDebug(msg); |
89 | return; | 90 | return; |
90 | } | 91 | } |
91 | } | 92 | } |
92 | setFileName( fileName ); | 93 | setFileName( fileName ); |
93 | } | 94 | } |
94 | 95 | ||
95 | Resourceolaccess::~Resourceolaccess() | 96 | Resourceolaccess::~Resourceolaccess() |
96 | { | 97 | { |
97 | if (mConverter != 0) | 98 | if (mConverter != 0) |
98 | delete mConverter; | 99 | delete mConverter; |
99 | 100 | ||
100 | //if(mAccess != 0) | 101 | //if(mAccess != 0) |
101 | //delete mAccess; | 102 | //delete mAccess; |
102 | } | 103 | } |
103 | 104 | ||
104 | void Resourceolaccess::writeConfig( KConfig *config ) | 105 | void Resourceolaccess::writeConfig( KConfig *config ) |
105 | { | 106 | { |
106 | Resource::writeConfig( config ); | 107 | Resource::writeConfig( config ); |
107 | } | 108 | } |
108 | 109 | ||
109 | Ticket *Resourceolaccess::requestSaveTicket() | 110 | Ticket *Resourceolaccess::requestSaveTicket() |
110 | { | 111 | { |
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp index 4843ce0..86b22b2 100644 --- a/microkde/kresources/factory.cpp +++ b/microkde/kresources/factory.cpp | |||
@@ -100,97 +100,97 @@ Factory::Factory( const QString& resourceFamily) : | |||
100 | info->descriptionLabel = i18n( "Connect to a directory server" ); | 100 | info->descriptionLabel = i18n( "Connect to a directory server" ); |
101 | mTypeMap.insert( "ldap", info ); | 101 | mTypeMap.insert( "ldap", info ); |
102 | 102 | ||
103 | //US add opie plugin only, if the library exists. | 103 | //US add opie plugin only, if the library exists. |
104 | /*US | 104 | /*US |
105 | QString libname = "microkabc_opie"; | 105 | QString libname = "microkabc_opie"; |
106 | QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); | 106 | QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); |
107 | if ( !path.isEmpty() ) | 107 | if ( !path.isEmpty() ) |
108 | { | 108 | { |
109 | info = new PluginInfo; | 109 | info = new PluginInfo; |
110 | info->library = libname; | 110 | info->library = libname; |
111 | info->nameLabel = i18n( "opie" ); | 111 | info->nameLabel = i18n( "opie" ); |
112 | info->descriptionLabel = i18n( "Opie PIM Addressbook." ); | 112 | info->descriptionLabel = i18n( "Opie PIM Addressbook." ); |
113 | mTypeMap.insert( "opie", info ); | 113 | mTypeMap.insert( "opie", info ); |
114 | } | 114 | } |
115 | */ | 115 | */ |
116 | //US add qtopia plugin only, if the library exists. | 116 | //US add qtopia plugin only, if the library exists. |
117 | QString libname = "microkabc_qtopia"; | 117 | QString libname = "microkabc_qtopia"; |
118 | QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); | 118 | QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); |
119 | if ( !path.isEmpty() ) | 119 | if ( !path.isEmpty() ) |
120 | { | 120 | { |
121 | info = new PluginInfo; | 121 | info = new PluginInfo; |
122 | info->library = libname; | 122 | info->library = libname; |
123 | info->nameLabel = i18n( "qtopia" ); | 123 | info->nameLabel = i18n( "qtopia" ); |
124 | info->descriptionLabel = i18n( "Qtopia PIM Addressbook." ); | 124 | info->descriptionLabel = i18n( "Qtopia PIM Addressbook." ); |
125 | mTypeMap.insert( "qtopia", info ); | 125 | mTypeMap.insert( "qtopia", info ); |
126 | } | 126 | } |
127 | 127 | ||
128 | //US add sharp plugin only, if the library exists. | 128 | //US add sharp plugin only, if the library exists. |
129 | libname = "microkabc_sharpdtm"; | 129 | libname = "microkabc_sharpdtm"; |
130 | path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); | 130 | path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); |
131 | if ( !path.isEmpty() ) | 131 | if ( !path.isEmpty() ) |
132 | { | 132 | { |
133 | info = new PluginInfo; | 133 | info = new PluginInfo; |
134 | info->library = libname; | 134 | info->library = libname; |
135 | info->nameLabel = i18n( "sharp" ); | 135 | info->nameLabel = i18n( "sharp" ); |
136 | info->descriptionLabel = i18n( "Sharp DTM Addressbook." ); | 136 | info->descriptionLabel = i18n( "Sharp DTM Addressbook." ); |
137 | mTypeMap.insert( "sharp", info ); | 137 | mTypeMap.insert( "sharp", info ); |
138 | } | 138 | } |
139 | 139 | ||
140 | 140 | ||
141 | //LR add ol plugin only, if the library exists. | 141 | //LR add ol plugin only, if the library exists. |
142 | libname = "microkabc_olaccess"; | 142 | libname = "microkabc_olaccess"; |
143 | path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); | 143 | path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); |
144 | if ( !path.isEmpty() ) | 144 | if ( !path.isEmpty() ) |
145 | { | 145 | { |
146 | info = new PluginInfo; | 146 | info = new PluginInfo; |
147 | info->library = libname; | 147 | info->library = libname; |
148 | info->nameLabel = i18n( "sharp" ); | 148 | info->nameLabel = i18n( "olaccess" ); |
149 | info->descriptionLabel = i18n( "Outlook Addressbook." ); | 149 | info->descriptionLabel = i18n( "Outlook Addressbook." ); |
150 | mTypeMap.insert( "olaccess", info ); | 150 | mTypeMap.insert( "olaccess", info ); |
151 | } | 151 | } |
152 | 152 | ||
153 | 153 | ||
154 | } | 154 | } |
155 | 155 | ||
156 | Factory::~Factory() | 156 | Factory::~Factory() |
157 | { | 157 | { |
158 | } | 158 | } |
159 | 159 | ||
160 | QStringList Factory::typeNames() const | 160 | QStringList Factory::typeNames() const |
161 | { | 161 | { |
162 | //US method QMap::keys() not available yet. SO collect the data manually | 162 | //US method QMap::keys() not available yet. SO collect the data manually |
163 | //US return mTypeMap.keys(); | 163 | //US return mTypeMap.keys(); |
164 | 164 | ||
165 | QStringList result; | 165 | QStringList result; |
166 | 166 | ||
167 | QMap<QString, PluginInfo*>::ConstIterator it; | 167 | QMap<QString, PluginInfo*>::ConstIterator it; |
168 | for( it = mTypeMap.begin(); it != mTypeMap.end(); ++it ) { | 168 | for( it = mTypeMap.begin(); it != mTypeMap.end(); ++it ) { |
169 | result << it.key().latin1(); | 169 | result << it.key().latin1(); |
170 | // qDebug("Factory::typeNames() : %s ", it.key().latin1()); | 170 | // qDebug("Factory::typeNames() : %s ", it.key().latin1()); |
171 | 171 | ||
172 | } | 172 | } |
173 | return result; | 173 | return result; |
174 | } | 174 | } |
175 | 175 | ||
176 | ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent ) | 176 | ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent ) |
177 | { | 177 | { |
178 | if ( type.isEmpty() || !mTypeMap.contains( type ) ) | 178 | if ( type.isEmpty() || !mTypeMap.contains( type ) ) |
179 | return 0; | 179 | return 0; |
180 | 180 | ||
181 | //US KService::Ptr ptr = mTypeMap[ type ]; | 181 | //US KService::Ptr ptr = mTypeMap[ type ]; |
182 | //US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() ); | 182 | //US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() ); |
183 | PluginInfo* pi = mTypeMap[ type ]; | 183 | PluginInfo* pi = mTypeMap[ type ]; |
184 | KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() ); | 184 | KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() ); |
185 | if ( !factory ) { | 185 | if ( !factory ) { |
186 | qDebug("KRES::Factory::configWidget(): Factory creation failed for library %s", pi->library.latin1()); | 186 | qDebug("KRES::Factory::configWidget(): Factory creation failed for library %s", pi->library.latin1()); |
187 | kdDebug() << "KRES::Factory::configWidget(): Factory creation failed" << endl; | 187 | kdDebug() << "KRES::Factory::configWidget(): Factory creation failed" << endl; |
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
190 | 190 | ||
191 | PluginFactoryBase *pluginFactory = static_cast<PluginFactoryBase *>( factory ); | 191 | PluginFactoryBase *pluginFactory = static_cast<PluginFactoryBase *>( factory ); |
192 | 192 | ||
193 | if ( !pluginFactory ) { | 193 | if ( !pluginFactory ) { |
194 | qDebug("KRES::Factory::configWidget(): no plugin factory for library %s", pi->library.latin1()); | 194 | qDebug("KRES::Factory::configWidget(): no plugin factory for library %s", pi->library.latin1()); |
195 | kdDebug() << "KRES::Factory::configWidget(): no plugin factory." << endl; | 195 | kdDebug() << "KRES::Factory::configWidget(): no plugin factory." << endl; |
196 | return 0; | 196 | return 0; |
diff --git a/variables.pri b/variables.pri index 9975cf0..5d3b6cb 100644 --- a/variables.pri +++ b/variables.pri | |||
@@ -1,14 +1,14 @@ | |||
1 | 1 | ||
2 | # variables settings for compilation for Linux desktop and Qt 3.x.x | 2 | # variables settings for compilation for Linux desktop and Qt 3.x.x |
3 | 3 | ||
4 | unix { | 4 | unix { |
5 | #for statically linking | 5 | #for statically linking |
6 | #CONFIG += staticlib | 6 | #CONFIG += staticlib |
7 | } | 7 | } |
8 | win32 { | 8 | win32 { |
9 | #disable importol to make it running on windows ME/98 | 9 | #disable importol to make it running on windows ME/98 |
10 | #CONFIG += importol | 10 | CONFIG += importol |
11 | 11 | ||
12 | } | 12 | } |
13 | CONFIG += thread | 13 | CONFIG += thread |
14 | CONFIG += release | 14 | CONFIG += release |