author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/xxportmanager.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/xxportmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/xxportmanager.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 405f7ec..95b240d 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp | |||
@@ -17,32 +17,34 @@ | |||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qlist.h> | 32 | #include <qlist.h> |
33 | //Added by qt3to4: | ||
34 | #include <Q3VBoxLayout> | ||
33 | 35 | ||
34 | #include <kabc/addressbook.h> | 36 | #include <kabc/addressbook.h> |
35 | #include <kabc/resource.h> | 37 | #include <kabc/resource.h> |
36 | #include <kdebug.h> | 38 | #include <kdebug.h> |
37 | #include <kdialogbase.h> | 39 | #include <kdialogbase.h> |
38 | #include <klocale.h> | 40 | #include <klocale.h> |
39 | #include <kmessagebox.h> | 41 | #include <kmessagebox.h> |
40 | 42 | ||
41 | #ifndef KAB_EMBEDDED | 43 | #ifndef KAB_EMBEDDED |
42 | #include <ktrader.h> | 44 | #include <ktrader.h> |
43 | #else //KAB_EMBEDDED | 45 | #else //KAB_EMBEDDED |
44 | extern "C" | 46 | extern "C" |
45 | { | 47 | { |
46 | void* init_microkaddrbk_csv_xxport(); | 48 | void* init_microkaddrbk_csv_xxport(); |
47 | void* init_microkaddrbk_kde2_xxport(); | 49 | void* init_microkaddrbk_kde2_xxport(); |
48 | void* init_microkaddrbk_vcard_xxport(); | 50 | void* init_microkaddrbk_vcard_xxport(); |
@@ -204,67 +206,64 @@ void XXPortManager::loadPlugins() | |||
204 | continue; | 206 | continue; |
205 | 207 | ||
206 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); | 208 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); |
207 | if ( !factory ) { | 209 | if ( !factory ) { |
208 | kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl; | 210 | kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl; |
209 | continue; | 211 | continue; |
210 | } | 212 | } |
211 | 213 | ||
212 | XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); | 214 | XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); |
213 | 215 | ||
214 | if ( !xxportFactory ) { | 216 | if ( !xxportFactory ) { |
215 | kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; | 217 | kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; |
216 | continue; | 218 | continue; |
217 | } | 219 | } |
218 | 220 | ||
219 | #else //KAB_EMBEDDED | 221 | #else //KAB_EMBEDDED |
220 | QList<XXPortFactory> factorylist; | 222 | QList<XXPortFactory*> factorylist; |
221 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); | 223 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); |
222 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); | 224 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); |
223 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); | 225 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); |
224 | //US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport())); | 226 | //US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport())); |
225 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); | 227 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); |
226 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); | 228 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); |
227 | 229 | ||
228 | QListIterator<XXPortFactory> it(factorylist); | 230 | for(QList<XXPortFactory*>::iterator it=factorylist.begin();it!=factorylist.end();++it) { |
229 | for ( ; it.current(); ++it ) | 231 | XXPortFactory *xxportFactory = *it; |
230 | { | ||
231 | XXPortFactory *xxportFactory = it.current(); | ||
232 | #endif //KAB_EMBEDDED | 232 | #endif //KAB_EMBEDDED |
233 | 233 | ||
234 | XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); | 234 | XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); |
235 | if ( obj ) { | 235 | if ( obj ) { |
236 | mCore->addGUIClient( obj ); | 236 | mCore->addGUIClient( obj ); |
237 | mXXPortObjects.insert( obj->identifier(), obj ); | 237 | mXXPortObjects.insert( obj->identifier(), obj ); |
238 | connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), | 238 | connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), |
239 | this, SLOT( slotExport( const QString&, const QString& ) ) ); | 239 | this, SLOT( slotExport( const QString&, const QString& ) ) ); |
240 | connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), | 240 | connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), |
241 | this, SLOT( slotImport( const QString&, const QString& ) ) ); | 241 | this, SLOT( slotImport( const QString&, const QString& ) ) ); |
242 | } | 242 | } |
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | 246 | ||
247 | PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, | 247 | PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, |
248 | const char *name ) | 248 | const char *name ) |
249 | : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent, | 249 | : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent, |
250 | name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) | 250 | name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) |
251 | { | 251 | { |
252 | QWidget *page = plainPage(); | 252 | QWidget *page = plainPage(); |
253 | QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); | 253 | Q3VBoxLayout *layout = new Q3VBoxLayout( page, marginHint(), spacingHint() ); |
254 | connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); | 254 | connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); |
255 | connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); | 255 | connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); |
256 | 256 | ||
257 | KABC::AddresseeView *view = new KABC::AddresseeView( page ); | 257 | KABC::AddresseeView *view = new KABC::AddresseeView( page ); |
258 | view->setAddressee( addr ); | 258 | view->setAddressee( addr ); |
259 | layout->addWidget( view ); | 259 | layout->addWidget( view ); |
260 | #ifdef DESKTOP_VERSION | 260 | #ifdef DESKTOP_VERSION |
261 | resize( 640, 480 ); | 261 | resize( 640, 480 ); |
262 | #else | 262 | #else |
263 | showMaximized(); | 263 | showMaximized(); |
264 | #endif | 264 | #endif |
265 | } | 265 | } |
266 | 266 | ||
267 | #ifndef KAB_EMBEDDED | 267 | #ifndef KAB_EMBEDDED_ |
268 | #include "xxportmanager.moc" | 268 | #include "moc_xxportmanager.cpp" |
269 | #endif //KAB_EMBEDDED | 269 | #endif //KAB_EMBEDDED |
270 | |||