author | zautrix <zautrix> | 2004-10-20 12:05:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-20 12:05:18 (UTC) |
commit | 5cf3c1bce58a6487af166e637e54571e98156fd0 (patch) (unidiff) | |
tree | 2e1ba14350aa322bb21729cf462b96e658fa6929 | |
parent | e2a0df411042d986adb31b28f9e0a2f17395358c (diff) | |
download | kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.zip kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.tar.gz kdepimpi-5cf3c1bce58a6487af166e637e54571e98156fd0.tar.bz2 |
OL import fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 8 | ||||
-rw-r--r-- | kaddressbook/kaimportoldialog.cpp | 46 | ||||
-rw-r--r-- | korganizer/koimportoldialog.cpp | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 8 |
4 files changed, 57 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 980e436..1074a62 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -321,26 +321,28 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
321 | } | 321 | } |
322 | 322 | ||
323 | KABCore::~KABCore() | 323 | KABCore::~KABCore() |
324 | { | 324 | { |
325 | // save(); | 325 | // save(); |
326 | //saveSettings(); | 326 | //saveSettings(); |
327 | //KABPrefs::instance()->writeConfig(); | 327 | //KABPrefs::instance()->writeConfig(); |
328 | delete AddresseeConfig::instance(); | 328 | delete AddresseeConfig::instance(); |
329 | mAddressBook = 0; | 329 | mAddressBook = 0; |
330 | KABC::StdAddressBook::close(); | 330 | KABC::StdAddressBook::close(); |
331 | 331 | ||
332 | delete syncManager; | 332 | delete syncManager; |
333 | #ifndef DESKTOP_VERSION | ||
333 | if ( infrared ) | 334 | if ( infrared ) |
334 | delete infrared; | 335 | delete infrared; |
336 | #endif | ||
335 | } | 337 | } |
336 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 338 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
337 | { | 339 | { |
338 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 340 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
339 | if ( cmsg == "setDocument(QString)" ) { | 341 | if ( cmsg == "setDocument(QString)" ) { |
340 | QDataStream stream( data, IO_ReadOnly ); | 342 | QDataStream stream( data, IO_ReadOnly ); |
341 | QString fileName; | 343 | QString fileName; |
342 | stream >> fileName; | 344 | stream >> fileName; |
343 | recieve( fileName ); | 345 | recieve( fileName ); |
344 | return; | 346 | return; |
345 | } | 347 | } |
346 | } | 348 | } |
@@ -358,35 +360,37 @@ void KABCore::toggleBeamReceive( ) | |||
358 | } | 360 | } |
359 | qDebug("AB enable BeamReceive "); | 361 | qDebug("AB enable BeamReceive "); |
360 | mActionBR->setChecked(true); | 362 | mActionBR->setChecked(true); |
361 | 363 | ||
362 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 364 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
363 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 365 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
364 | #endif | 366 | #endif |
365 | } | 367 | } |
366 | 368 | ||
367 | 369 | ||
368 | void KABCore::disableBR(bool b) | 370 | void KABCore::disableBR(bool b) |
369 | { | 371 | { |
372 | #ifndef DESKTOP_VERSION | ||
370 | if ( b ) { | 373 | if ( b ) { |
371 | if ( infrared ) { | 374 | if ( infrared ) { |
372 | toggleBeamReceive( ); | 375 | toggleBeamReceive( ); |
373 | mBRdisabled = true; | ||
374 | } | 376 | } |
377 | mBRdisabled = true; | ||
375 | } else { | 378 | } else { |
376 | if ( mBRdisabled ) { | 379 | if ( mBRdisabled ) { |
377 | mBRdisabled = false; | 380 | mBRdisabled = false; |
378 | toggleBeamReceive( ); | 381 | //toggleBeamReceive( ); |
379 | } | 382 | } |
380 | } | 383 | } |
384 | #endif | ||
381 | 385 | ||
382 | } | 386 | } |
383 | void KABCore::recieve( QString fn ) | 387 | void KABCore::recieve( QString fn ) |
384 | { | 388 | { |
385 | //qDebug("KABCore::recieve "); | 389 | //qDebug("KABCore::recieve "); |
386 | int count = mAddressBook->importFromFile( fn, true ); | 390 | int count = mAddressBook->importFromFile( fn, true ); |
387 | mViewManager->refreshView(); | 391 | mViewManager->refreshView(); |
388 | message(i18n("%1 contact(s) received!").arg( count )); | 392 | message(i18n("%1 contact(s) received!").arg( count )); |
389 | topLevelWidget()->showMaximized(); | 393 | topLevelWidget()->showMaximized(); |
390 | topLevelWidget()->raise(); | 394 | topLevelWidget()->raise(); |
391 | } | 395 | } |
392 | void KABCore::restoreSettings() | 396 | void KABCore::restoreSettings() |
diff --git a/kaddressbook/kaimportoldialog.cpp b/kaddressbook/kaimportoldialog.cpp index 10e3c76..848d8af 100644 --- a/kaddressbook/kaimportoldialog.cpp +++ b/kaddressbook/kaimportoldialog.cpp | |||
@@ -20,24 +20,25 @@ | |||
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 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qframe.h> | 25 | #include <qframe.h> |
26 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qprogressbar.h> | 28 | #include <qprogressbar.h> |
29 | #include <qwidgetstack.h> | 29 | #include <qwidgetstack.h> |
30 | #include <qdatetime.h> | 30 | #include <qdatetime.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qregexp.h> | ||
32 | #include <qapplication.h> | 33 | #include <qapplication.h> |
33 | #include <qhbox.h> | 34 | #include <qhbox.h> |
34 | #include <qheader.h> | 35 | #include <qheader.h> |
35 | #include <qdatetime.h> | 36 | #include <qdatetime.h> |
36 | #include <qlistview.h> | 37 | #include <qlistview.h> |
37 | 38 | ||
38 | #include <kdebug.h> | 39 | #include <kdebug.h> |
39 | #include <klocale.h> | 40 | #include <klocale.h> |
40 | #include <kstandarddirs.h> | 41 | #include <kstandarddirs.h> |
41 | #include <kmessagebox.h> | 42 | #include <kmessagebox.h> |
42 | #include <kfiledialog.h> | 43 | #include <kfiledialog.h> |
43 | 44 | ||
@@ -258,68 +259,69 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) | |||
258 | addressee.setSuffix( QString::fromUcs2(aItem->GetSuffix().GetBuffer()) ); | 259 | addressee.setSuffix( QString::fromUcs2(aItem->GetSuffix().GetBuffer()) ); |
259 | addressee.setNickName( QString::fromUcs2(aItem->GetNickName().GetBuffer()) ); | 260 | addressee.setNickName( QString::fromUcs2(aItem->GetNickName().GetBuffer()) ); |
260 | QDateTime dtb = mDdate2Qdtr(aItem->GetBirthday()); | 261 | QDateTime dtb = mDdate2Qdtr(aItem->GetBirthday()); |
261 | if ( dtb.isValid() ) | 262 | if ( dtb.isValid() ) |
262 | addressee.setBirthday( mDdate2Qdtr(aItem->GetBirthday())); | 263 | addressee.setBirthday( mDdate2Qdtr(aItem->GetBirthday())); |
263 | 264 | ||
264 | //QString::fromUcs2(aItem->.GetBuffer()) | 265 | //QString::fromUcs2(aItem->.GetBuffer()) |
265 | //addressee.setMailer( const QString &mailer ); | 266 | //addressee.setMailer( const QString &mailer ); |
266 | //addressee.setTimeZone( const TimeZone &timeZone ); | 267 | //addressee.setTimeZone( const TimeZone &timeZone ); |
267 | //addressee.setGeo( const Geo &geo ); | 268 | //addressee.setGeo( const Geo &geo ); |
268 | //addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix | 269 | //addressee.setTitle( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) );// titel is the prefix |
269 | addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) ); | 270 | addressee.setRole( QString::fromUcs2(aItem->GetJobTitle().GetBuffer()) ); |
270 | addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()) ); | 271 | addressee.setOrganization( QString::fromUcs2(aItem->GetCompanyName().GetBuffer()).replace( QRegExp("\\r"), "") ); |
271 | QString notesStr = QString::fromUcs2(aItem->GetBody().GetBuffer()); | 272 | QString notesStr = QString::fromUcs2(aItem->GetBody().GetBuffer()); |
273 | notesStr.replace( QRegExp("\\r"), ""); | ||
272 | 274 | ||
273 | addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) ); | 275 | addressee.setProductId( QString::fromUcs2(aItem->GetCustomerID().GetBuffer()) ); |
274 | //addressee.setRevision( const QDateTime &revision ); | 276 | //addressee.setRevision( const QDateTime &revision ); |
275 | // addressee.setSortString( const QString &sortString ); | 277 | // addressee.setSortString( const QString &sortString ); |
276 | addressee.setUrl( QString::fromUcs2(aItem->GetWebPage().GetBuffer()) ); | 278 | addressee.setUrl( QString::fromUcs2(aItem->GetWebPage().GetBuffer()) ); |
277 | 279 | ||
278 | QString tempS; | 280 | QString tempS; |
279 | tempS = QString::fromUcs2(aItem->GetNetMeetingAlias().GetBuffer())+" AT SERVER: " +QString::fromUcs2(aItem->GetNetMeetingServer().GetBuffer()); | 281 | tempS = QString::fromUcs2(aItem->GetNetMeetingAlias().GetBuffer())+" AT SERVER: " +QString::fromUcs2(aItem->GetNetMeetingServer().GetBuffer()); |
280 | if ( tempS.length() > 12 ) | 282 | if ( tempS.length() > 12 ) |
281 | addressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", tempS ); | 283 | addressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", tempS ); |
282 | tempS = QString::fromUcs2(aItem->GetSpouse().GetBuffer()); | 284 | tempS = QString::fromUcs2(aItem->GetSpouse().GetBuffer()); |
283 | if ( !tempS.isEmpty() ) | 285 | if ( !tempS.isEmpty() ) |
284 | addressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", tempS ); | 286 | addressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", tempS ); |
285 | tempS = QString::fromUcs2(aItem->GetManagerName().GetBuffer()); | 287 | tempS = QString::fromUcs2(aItem->GetManagerName().GetBuffer()); |
286 | if ( !tempS.isEmpty() ) | 288 | if ( !tempS.isEmpty() ) |
287 | addressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", tempS ); | 289 | addressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", tempS ); |
288 | tempS = QString::fromUcs2(aItem->GetAssistantName().GetBuffer()); | 290 | tempS = QString::fromUcs2(aItem->GetAssistantName().GetBuffer()); |
289 | if ( !tempS.isEmpty() ) | 291 | if ( !tempS.isEmpty() ) |
290 | addressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", tempS ); | 292 | addressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", tempS ); |
291 | tempS = QString::fromUcs2(aItem->GetDepartment().GetBuffer()); | 293 | tempS = QString::fromUcs2(aItem->GetDepartment().GetBuffer()); |
292 | if ( !tempS.isEmpty() ) | 294 | if ( !tempS.isEmpty() ) |
293 | addressee.insertCustom( "KADDRESSBOOK", "X-Department", tempS ); | 295 | addressee.insertCustom( "KADDRESSBOOK", "X-Department", tempS ); |
294 | tempS = QString::fromUcs2(aItem->GetOfficeLocation().GetBuffer()); | 296 | tempS = QString::fromUcs2(aItem->GetOfficeLocation().GetBuffer()).replace( QRegExp("\\r"), ""); |
295 | if ( !tempS.isEmpty() ) | 297 | if ( !tempS.isEmpty() ) |
296 | addressee.insertCustom( "KADDRESSBOOK", "X-Office",tempS ); | 298 | addressee.insertCustom( "KADDRESSBOOK", "X-Office",tempS ); |
297 | tempS = QString::fromUcs2(aItem->GetProfession().GetBuffer()); | 299 | tempS = QString::fromUcs2(aItem->GetProfession().GetBuffer()); |
298 | if ( !tempS.isEmpty() ) | 300 | if ( !tempS.isEmpty() ) |
299 | addressee.insertCustom( "KADDRESSBOOK", "X-Profession", tempS ); | 301 | addressee.insertCustom( "KADDRESSBOOK", "X-Profession", tempS ); |
300 | dtb = mDdate2Qdtr(aItem->GetAnniversary()); | 302 | dtb = mDdate2Qdtr(aItem->GetAnniversary()); |
301 | if (dtb.isValid() ) { | 303 | if (dtb.isValid() ) { |
302 | QString dt = KGlobal::locale()->formatDate( dtb.date() , true, KLocale::ISODate); | 304 | QString dt = KGlobal::locale()->formatDate( dtb.date() , true, KLocale::ISODate); |
303 | addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); | 305 | addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); |
304 | } | 306 | } |
305 | int sec = aItem->GetSensitivity() ; | 307 | int sec = aItem->GetSensitivity() ; |
306 | if ( sec > 1 )// mapping pers -> private | 308 | if ( sec > 1 )// mapping pers -> private |
307 | --sec; | 309 | --sec; |
308 | addressee.setSecrecy( sec ); | 310 | addressee.setSecrecy( sec ); |
309 | //addressee.setLogo( const Picture &logo ); | 311 | //addressee.setLogo( const Picture &logo ); |
310 | //addressee.setPhoto( const Picture &photo ); | 312 | //addressee.setPhoto( const Picture &photo ); |
311 | //addressee.setSound( const Sound &sound ); | 313 | //addressee.setSound( const Sound &sound ); |
312 | //addressee.setAgent( const Agent &agent ); | 314 | //addressee.setAgent( const Agent &agent ); |
313 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); | 315 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()).replace( QRegExp("\\r"), ""); |
314 | addressee.setCategories( QStringList::split( ";", cat )); | 316 | addressee.setCategories( QStringList::split( ";", cat )); |
315 | 317 | ||
316 | QString phoneS; | 318 | QString phoneS; |
317 | 319 | ||
318 | phoneS = QString::fromUcs2( aItem->GetAssistantTelephoneNumber().GetBuffer()); | 320 | phoneS = QString::fromUcs2( aItem->GetAssistantTelephoneNumber().GetBuffer()); |
319 | if ( ! phoneS.isEmpty()) | 321 | if ( ! phoneS.isEmpty()) |
320 | addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work + KABC::PhoneNumber::Voice ) ); | 322 | addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work + KABC::PhoneNumber::Voice ) ); |
321 | phoneS = QString::fromUcs2( aItem->GetBusinessTelephoneNumber().GetBuffer()); | 323 | phoneS = QString::fromUcs2( aItem->GetBusinessTelephoneNumber().GetBuffer()); |
322 | if ( ! phoneS.isEmpty()) | 324 | if ( ! phoneS.isEmpty()) |
323 | addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work ) ); | 325 | addressee.insertPhoneNumber( KABC::PhoneNumber(phoneS ,KABC::PhoneNumber::Work ) ); |
324 | phoneS = QString::fromUcs2( aItem->GetBusiness2TelephoneNumber().GetBuffer()); | 326 | phoneS = QString::fromUcs2( aItem->GetBusiness2TelephoneNumber().GetBuffer()); |
325 | if ( ! phoneS.isEmpty()) | 327 | if ( ! phoneS.isEmpty()) |
@@ -387,182 +389,209 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) | |||
387 | phoneS = QString::fromUcs2( aItem->GetEmail3Address().GetBuffer()); | 389 | phoneS = QString::fromUcs2( aItem->GetEmail3Address().GetBuffer()); |
388 | if ( ! phoneS.isEmpty()) { | 390 | if ( ! phoneS.isEmpty()) { |
389 | addressee.insertEmail(phoneS , preferred ); | 391 | addressee.insertEmail(phoneS , preferred ); |
390 | preferred = false; | 392 | preferred = false; |
391 | } | 393 | } |
392 | // is this the number of the preferred email? | 394 | // is this the number of the preferred email? |
393 | //long GetSelectedMailingAddress();??? | 395 | //long GetSelectedMailingAddress();??? |
394 | 396 | ||
395 | KABC::Address addressHome; | 397 | KABC::Address addressHome; |
396 | KABC::Address* addressAdd = &addressHome; | 398 | KABC::Address* addressAdd = &addressHome; |
397 | bool insert = false; | 399 | bool insert = false; |
398 | phoneS = QString::fromUcs2( aItem->GetHomeAddressCountry().GetBuffer()); | 400 | phoneS = QString::fromUcs2( aItem->GetHomeAddressCountry().GetBuffer()); |
401 | phoneS.replace( QRegExp("\\r"), ""); | ||
399 | if ( ! phoneS.isEmpty()) { | 402 | if ( ! phoneS.isEmpty()) { |
400 | addressAdd->setCountry(phoneS ); | 403 | addressAdd->setCountry(phoneS ); |
401 | insert = true; | 404 | insert = true; |
402 | } | 405 | } |
403 | phoneS = QString::fromUcs2( aItem->GetHomeAddressState().GetBuffer()); | 406 | phoneS = QString::fromUcs2( aItem->GetHomeAddressState().GetBuffer()); |
407 | phoneS.replace( QRegExp("\\r"), ""); | ||
404 | if ( ! phoneS.isEmpty()) { | 408 | if ( ! phoneS.isEmpty()) { |
405 | addressAdd->setRegion(phoneS ); | 409 | addressAdd->setRegion(phoneS ); |
406 | insert = true; | 410 | insert = true; |
407 | } | 411 | } |
408 | phoneS = QString::fromUcs2( aItem->GetHomeAddressCity().GetBuffer()); | 412 | phoneS = QString::fromUcs2( aItem->GetHomeAddressCity().GetBuffer()); |
413 | phoneS.replace( QRegExp("\\r"), ""); | ||
409 | if ( ! phoneS.isEmpty()) { | 414 | if ( ! phoneS.isEmpty()) { |
410 | addressAdd->setLocality(phoneS ); | 415 | addressAdd->setLocality(phoneS ); |
411 | insert = true; | 416 | insert = true; |
412 | } | 417 | } |
413 | phoneS = QString::fromUcs2( aItem->GetHomeAddressPostalCode().GetBuffer()); | 418 | phoneS = QString::fromUcs2( aItem->GetHomeAddressPostalCode().GetBuffer()); |
419 | phoneS.replace( QRegExp("\\r"), ""); | ||
414 | if ( ! phoneS.isEmpty()) { | 420 | if ( ! phoneS.isEmpty()) { |
415 | addressAdd->setPostalCode(phoneS ); | 421 | addressAdd->setPostalCode(phoneS ); |
416 | insert = true; | 422 | insert = true; |
417 | } | 423 | } |
418 | phoneS = QString::fromUcs2( aItem->GetHomeAddressPostOfficeBox().GetBuffer()); | 424 | phoneS = QString::fromUcs2( aItem->GetHomeAddressPostOfficeBox().GetBuffer()); |
425 | phoneS.replace( QRegExp("\\r"), ""); | ||
419 | if ( ! phoneS.isEmpty()) { | 426 | if ( ! phoneS.isEmpty()) { |
420 | addressAdd->setPostOfficeBox(phoneS ); | 427 | addressAdd->setPostOfficeBox(phoneS ); |
421 | insert = true; | 428 | insert = true; |
422 | } | 429 | } |
423 | phoneS = QString::fromUcs2( aItem->GetHomeAddressStreet().GetBuffer()); | 430 | phoneS = QString::fromUcs2( aItem->GetHomeAddressStreet().GetBuffer()); |
431 | phoneS.replace( QRegExp("\\r"), ""); | ||
424 | if ( ! phoneS.isEmpty()) { | 432 | if ( ! phoneS.isEmpty()) { |
425 | addressAdd->setStreet(phoneS ); | 433 | addressAdd->setStreet(phoneS ); |
426 | insert = true; | 434 | insert = true; |
427 | } | 435 | } |
428 | phoneS = QString::fromUcs2( aItem->GetHomeAddress().GetBuffer()); | 436 | phoneS = QString::fromUcs2( aItem->GetHomeAddress().GetBuffer()); |
437 | phoneS.replace( QRegExp("\\r"), ""); | ||
429 | if ( ! phoneS.isEmpty()) { | 438 | if ( ! phoneS.isEmpty()) { |
430 | // redundant !addressAdd->setExtended(phoneS ); | 439 | // redundant !addressAdd->setExtended(phoneS ); |
431 | // insert = true; | 440 | // insert = true; |
432 | } | 441 | } |
433 | addressAdd->setType( KABC::Address::Home ); | 442 | addressAdd->setType( KABC::Address::Home ); |
434 | if ( insert ) | 443 | if ( insert ) |
435 | addressee.insertAddress( *addressAdd ); | 444 | addressee.insertAddress( *addressAdd ); |
436 | // ++++++++++++++++++++++ end of address | 445 | // ++++++++++++++++++++++ end of address |
437 | 446 | ||
438 | KABC::Address addressWork; | 447 | KABC::Address addressWork; |
439 | addressAdd = &addressWork; | 448 | addressAdd = &addressWork; |
440 | insert = false; | 449 | insert = false; |
441 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressCountry().GetBuffer()); | 450 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressCountry().GetBuffer()); |
451 | phoneS.replace( QRegExp("\\r"), ""); | ||
442 | if ( ! phoneS.isEmpty()) { | 452 | if ( ! phoneS.isEmpty()) { |
443 | addressAdd->setCountry(phoneS ); | 453 | addressAdd->setCountry(phoneS ); |
444 | insert = true; | 454 | insert = true; |
445 | } | 455 | } |
446 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressState().GetBuffer()); | 456 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressState().GetBuffer()); |
457 | phoneS.replace( QRegExp("\\r"), ""); | ||
447 | if ( ! phoneS.isEmpty()) { | 458 | if ( ! phoneS.isEmpty()) { |
448 | addressAdd->setRegion(phoneS ); | 459 | addressAdd->setRegion(phoneS ); |
449 | insert = true; | 460 | insert = true; |
450 | } | 461 | } |
451 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressCity().GetBuffer()); | 462 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressCity().GetBuffer()); |
463 | phoneS.replace( QRegExp("\\r"), ""); | ||
452 | if ( ! phoneS.isEmpty()) { | 464 | if ( ! phoneS.isEmpty()) { |
453 | addressAdd->setLocality(phoneS ); | 465 | addressAdd->setLocality(phoneS ); |
454 | insert = true; | 466 | insert = true; |
455 | } | 467 | } |
456 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressPostalCode().GetBuffer()); | 468 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressPostalCode().GetBuffer()); |
469 | phoneS.replace( QRegExp("\\r"), ""); | ||
457 | if ( ! phoneS.isEmpty()) { | 470 | if ( ! phoneS.isEmpty()) { |
458 | addressAdd->setPostalCode(phoneS ); | 471 | addressAdd->setPostalCode(phoneS ); |
459 | insert = true; | 472 | insert = true; |
460 | } | 473 | } |
461 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressPostOfficeBox().GetBuffer()); | 474 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressPostOfficeBox().GetBuffer()); |
475 | phoneS.replace( QRegExp("\\r"), ""); | ||
462 | if ( ! phoneS.isEmpty()) { | 476 | if ( ! phoneS.isEmpty()) { |
463 | addressAdd->setPostOfficeBox(phoneS ); | 477 | addressAdd->setPostOfficeBox(phoneS ); |
464 | insert = true; | 478 | insert = true; |
465 | } | 479 | } |
466 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressStreet().GetBuffer()); | 480 | phoneS = QString::fromUcs2( aItem->GetBusinessAddressStreet().GetBuffer()); |
481 | phoneS.replace( QRegExp("\\r"), ""); | ||
467 | if ( ! phoneS.isEmpty()) { | 482 | if ( ! phoneS.isEmpty()) { |
468 | addressAdd->setStreet(phoneS ); | 483 | addressAdd->setStreet(phoneS ); |
469 | insert = true; | 484 | insert = true; |
470 | } | 485 | } |
471 | phoneS = QString::fromUcs2( aItem->GetBusinessAddress().GetBuffer()); | 486 | phoneS = QString::fromUcs2( aItem->GetBusinessAddress().GetBuffer()); |
487 | phoneS.replace( QRegExp("\\r"), ""); | ||
472 | if ( ! phoneS.isEmpty()) { | 488 | if ( ! phoneS.isEmpty()) { |
473 | // redundant !addressAdd->setExtended(phoneS ); | 489 | // redundant !addressAdd->setExtended(phoneS ); |
474 | // insert = true; | 490 | // insert = true; |
475 | } | 491 | } |
476 | addressAdd->setType( KABC::Address::Work ); | 492 | addressAdd->setType( KABC::Address::Work ); |
477 | if ( insert ) | 493 | if ( insert ) |
478 | addressee.insertAddress( *addressAdd ); | 494 | addressee.insertAddress( *addressAdd ); |
479 | // ++++++++++++++++++++++ end of address | 495 | // ++++++++++++++++++++++ end of address |
480 | 496 | ||
481 | KABC::Address addressOther; | 497 | KABC::Address addressOther; |
482 | addressAdd = &addressOther; | 498 | addressAdd = &addressOther; |
483 | insert = false; | 499 | insert = false; |
484 | phoneS = QString::fromUcs2( aItem->GetOtherAddressCountry().GetBuffer()); | 500 | phoneS = QString::fromUcs2( aItem->GetOtherAddressCountry().GetBuffer()); |
501 | phoneS.replace( QRegExp("\\r"), ""); | ||
485 | if ( ! phoneS.isEmpty()) { | 502 | if ( ! phoneS.isEmpty()) { |
486 | addressAdd->setCountry(phoneS ); | 503 | addressAdd->setCountry(phoneS ); |
487 | insert = true; | 504 | insert = true; |
488 | } | 505 | } |
489 | phoneS = QString::fromUcs2( aItem->GetOtherAddressState().GetBuffer()); | 506 | phoneS = QString::fromUcs2( aItem->GetOtherAddressState().GetBuffer()); |
507 | phoneS.replace( QRegExp("\\r"), ""); | ||
490 | if ( ! phoneS.isEmpty()) { | 508 | if ( ! phoneS.isEmpty()) { |
491 | addressAdd->setRegion(phoneS ); | 509 | addressAdd->setRegion(phoneS ); |
492 | insert = true; | 510 | insert = true; |
493 | } | 511 | } |
494 | phoneS = QString::fromUcs2( aItem->GetOtherAddressCity().GetBuffer()); | 512 | phoneS = QString::fromUcs2( aItem->GetOtherAddressCity().GetBuffer()); |
513 | phoneS.replace( QRegExp("\\r"), ""); | ||
495 | if ( ! phoneS.isEmpty()) { | 514 | if ( ! phoneS.isEmpty()) { |
496 | addressAdd->setLocality(phoneS ); | 515 | addressAdd->setLocality(phoneS ); |
497 | insert = true; | 516 | insert = true; |
498 | } | 517 | } |
499 | phoneS = QString::fromUcs2( aItem->GetOtherAddressPostalCode().GetBuffer()); | 518 | phoneS = QString::fromUcs2( aItem->GetOtherAddressPostalCode().GetBuffer()); |
519 | phoneS.replace( QRegExp("\\r"), ""); | ||
500 | if ( ! phoneS.isEmpty()) { | 520 | if ( ! phoneS.isEmpty()) { |
501 | addressAdd->setPostalCode(phoneS ); | 521 | addressAdd->setPostalCode(phoneS ); |
502 | insert = true; | 522 | insert = true; |
503 | } | 523 | } |
504 | phoneS = QString::fromUcs2( aItem->GetOtherAddressPostOfficeBox().GetBuffer()); | 524 | phoneS = QString::fromUcs2( aItem->GetOtherAddressPostOfficeBox().GetBuffer()); |
525 | phoneS.replace( QRegExp("\\r"), ""); | ||
505 | if ( ! phoneS.isEmpty()) { | 526 | if ( ! phoneS.isEmpty()) { |
506 | addressAdd->setPostOfficeBox(phoneS ); | 527 | addressAdd->setPostOfficeBox(phoneS ); |
507 | insert = true; | 528 | insert = true; |
508 | } | 529 | } |
509 | phoneS = QString::fromUcs2( aItem->GetOtherAddressStreet().GetBuffer()); | 530 | phoneS = QString::fromUcs2( aItem->GetOtherAddressStreet().GetBuffer()); |
531 | phoneS.replace( QRegExp("\\r"), ""); | ||
510 | if ( ! phoneS.isEmpty()) { | 532 | if ( ! phoneS.isEmpty()) { |
511 | addressAdd->setStreet(phoneS ); | 533 | addressAdd->setStreet(phoneS ); |
512 | insert = true; | 534 | insert = true; |
513 | } | 535 | } |
514 | phoneS = QString::fromUcs2( aItem->GetOtherAddress().GetBuffer()); | 536 | phoneS = QString::fromUcs2( aItem->GetOtherAddress().GetBuffer()); |
515 | if ( ! phoneS.isEmpty()) { | 537 | if ( ! phoneS.isEmpty()) { |
516 | // redundant !addressAdd->setExtended(phoneS ); | 538 | // redundant !addressAdd->setExtended(phoneS ); |
517 | //insert = true; | 539 | //insert = true; |
518 | } | 540 | } |
519 | //addressAdd->setId( ); | 541 | //addressAdd->setId( ); |
520 | if ( insert ) | 542 | if ( insert ) |
521 | addressee.insertAddress( *addressAdd ); | 543 | addressee.insertAddress( *addressAdd ); |
522 | // ++++++++++++++++++++++ end of address | 544 | // ++++++++++++++++++++++ end of address |
523 | KABC::Address addressMail; | 545 | KABC::Address addressMail; |
524 | addressAdd = &addressMail; | 546 | addressAdd = &addressMail; |
525 | insert = false; | 547 | insert = false; |
526 | phoneS = QString::fromUcs2( aItem->GetMailingAddressCountry().GetBuffer()); | 548 | phoneS = QString::fromUcs2( aItem->GetMailingAddressCountry().GetBuffer()); |
549 | phoneS.replace( QRegExp("\\r"), ""); | ||
527 | if ( ! phoneS.isEmpty()) { | 550 | if ( ! phoneS.isEmpty()) { |
528 | addressAdd->setCountry(phoneS ); | 551 | addressAdd->setCountry(phoneS ); |
529 | insert = true; | 552 | insert = true; |
530 | } | 553 | } |
531 | phoneS = QString::fromUcs2( aItem->GetMailingAddressState().GetBuffer()); | 554 | phoneS = QString::fromUcs2( aItem->GetMailingAddressState().GetBuffer()); |
555 | phoneS.replace( QRegExp("\\r"), ""); | ||
532 | if ( ! phoneS.isEmpty()) { | 556 | if ( ! phoneS.isEmpty()) { |
533 | addressAdd->setRegion(phoneS ); | 557 | addressAdd->setRegion(phoneS ); |
534 | insert = true; | 558 | insert = true; |
535 | } | 559 | } |
536 | phoneS = QString::fromUcs2( aItem->GetMailingAddressCity().GetBuffer()); | 560 | phoneS = QString::fromUcs2( aItem->GetMailingAddressCity().GetBuffer()); |
561 | phoneS.replace( QRegExp("\\r"), ""); | ||
537 | if ( ! phoneS.isEmpty()) { | 562 | if ( ! phoneS.isEmpty()) { |
538 | addressAdd->setLocality(phoneS ); | 563 | addressAdd->setLocality(phoneS ); |
539 | insert = true; | 564 | insert = true; |
540 | } | 565 | } |
541 | phoneS = QString::fromUcs2( aItem->GetMailingAddressPostalCode().GetBuffer()); | 566 | phoneS = QString::fromUcs2( aItem->GetMailingAddressPostalCode().GetBuffer()); |
567 | phoneS.replace( QRegExp("\\r"), ""); | ||
542 | if ( ! phoneS.isEmpty()) { | 568 | if ( ! phoneS.isEmpty()) { |
543 | addressAdd->setPostalCode(phoneS ); | 569 | addressAdd->setPostalCode(phoneS ); |
544 | insert = true; | 570 | insert = true; |
545 | } | 571 | } |
546 | phoneS = QString::fromUcs2( aItem->GetMailingAddressPostOfficeBox().GetBuffer()); | 572 | phoneS = QString::fromUcs2( aItem->GetMailingAddressPostOfficeBox().GetBuffer()); |
573 | phoneS.replace( QRegExp("\\r"), ""); | ||
547 | if ( ! phoneS.isEmpty()) { | 574 | if ( ! phoneS.isEmpty()) { |
548 | addressAdd->setPostOfficeBox(phoneS ); | 575 | addressAdd->setPostOfficeBox(phoneS ); |
549 | insert = true; | 576 | insert = true; |
550 | } | 577 | } |
551 | phoneS = QString::fromUcs2( aItem->GetMailingAddressStreet().GetBuffer()); | 578 | phoneS = QString::fromUcs2( aItem->GetMailingAddressStreet().GetBuffer()); |
579 | phoneS.replace( QRegExp("\\r"), ""); | ||
552 | if ( ! phoneS.isEmpty()) { | 580 | if ( ! phoneS.isEmpty()) { |
553 | addressAdd->setStreet(phoneS ); | 581 | addressAdd->setStreet(phoneS ); |
554 | insert = true; | 582 | insert = true; |
555 | } | 583 | } |
556 | phoneS = QString::fromUcs2( aItem->GetMailingAddress().GetBuffer()); | 584 | phoneS = QString::fromUcs2( aItem->GetMailingAddress().GetBuffer()); |
585 | phoneS.replace( QRegExp("\\r"), ""); | ||
557 | if ( ! phoneS.isEmpty()) { | 586 | if ( ! phoneS.isEmpty()) { |
558 | // redundant ! addressAdd->setExtended(phoneS ); | 587 | // redundant ! addressAdd->setExtended(phoneS ); |
559 | // insert = true; | 588 | // insert = true; |
560 | } | 589 | } |
561 | addressAdd->setType( KABC::Address::Postal ); | 590 | addressAdd->setType( KABC::Address::Postal ); |
562 | if ( insert ) { | 591 | if ( insert ) { |
563 | addressee.insertAddress( *addressAdd ); | 592 | addressee.insertAddress( *addressAdd ); |
564 | } | 593 | } |
565 | // the following code is disabled | 594 | // the following code is disabled |
566 | // it does not seem to be useful | 595 | // it does not seem to be useful |
567 | #if 0 | 596 | #if 0 |
568 | if ( insert ) { | 597 | if ( insert ) { |
@@ -582,79 +611,88 @@ void KAImportOLdialog::ol2kapiContact( _ContactItem * aItem ) | |||
582 | addressOther.setType( KABC::Address::Postal ); | 611 | addressOther.setType( KABC::Address::Postal ); |
583 | addressee.insertAddress( addressOther ); | 612 | addressee.insertAddress( addressOther ); |
584 | } else { | 613 | } else { |
585 | addressee.insertAddress( *addressAdd ); | 614 | addressee.insertAddress( *addressAdd ); |
586 | } | 615 | } |
587 | } | 616 | } |
588 | } | 617 | } |
589 | } | 618 | } |
590 | #endif | 619 | #endif |
591 | // ++++++++++++++++++++++ end of ALL addresses | 620 | // ++++++++++++++++++++++ end of ALL addresses |
592 | //GetUserProperties(); | 621 | //GetUserProperties(); |
593 | tempS = QString::fromUcs2(aItem->GetInternetFreeBusyAddress().GetBuffer()); | 622 | tempS = QString::fromUcs2(aItem->GetInternetFreeBusyAddress().GetBuffer()); |
623 | phoneS.replace( QRegExp("\\r"), ""); | ||
594 | if ( !tempS.isEmpty() ) | 624 | if ( !tempS.isEmpty() ) |
595 | addressee.insertCustom( "KADDRESSBOOK", "X-FreeBusyUrl", tempS ); | 625 | addressee.insertCustom( "KADDRESSBOOK", "X-FreeBusyUrl", tempS ); |
596 | tempS = QString::fromUcs2(aItem->GetChildren().GetBuffer()); | 626 | tempS = QString::fromUcs2(aItem->GetChildren().GetBuffer()); |
597 | if ( !tempS.isEmpty() ) | 627 | if ( !tempS.isEmpty() ) |
598 | addressee.insertCustom( "KADDRESSBOOK", "X-Children", tempS ); | 628 | addressee.insertCustom( "KADDRESSBOOK", "X-Children", tempS ); |
599 | int gen = aItem->GetGender(); | 629 | int gen = aItem->GetGender(); |
600 | if ( gen != 0 ) { // 0 undef - 1 female - 2 male | 630 | if ( gen != 0 ) { // 0 undef - 1 female - 2 male |
601 | if ( gen == 1 ) | 631 | if ( gen == 1 ) |
602 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female" ); | 632 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female" ); |
603 | else | 633 | else |
604 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male" ); | 634 | addressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male" ); |
605 | } | 635 | } |
606 | QString additionalInfo; | 636 | QString additionalInfo; |
607 | QString tempAdd; | 637 | QString tempAdd; |
608 | tempAdd = QString::fromUcs2(aItem->GetLanguage().GetBuffer()); | 638 | tempAdd = QString::fromUcs2(aItem->GetLanguage().GetBuffer()); |
609 | if ( ! tempAdd.isEmpty() ) { | 639 | if ( ! tempAdd.isEmpty() ) { |
610 | additionalInfo += i18n("\nLanguage: "); | 640 | additionalInfo += i18n("\nLanguage: "); |
611 | additionalInfo += tempAdd; | 641 | additionalInfo += tempAdd; |
612 | } | 642 | } |
613 | tempAdd = QString::fromUcs2(aItem->GetHobby().GetBuffer()); | 643 | tempAdd = QString::fromUcs2(aItem->GetHobby().GetBuffer()); |
644 | phoneS.replace( QRegExp("\\r"), ""); | ||
614 | if ( ! tempAdd.isEmpty() ) { | 645 | if ( ! tempAdd.isEmpty() ) { |
615 | additionalInfo += i18n("\nHobby: "); | 646 | additionalInfo += i18n("\nHobby: "); |
616 | additionalInfo += tempAdd;; | 647 | additionalInfo += tempAdd;; |
617 | } | 648 | } |
618 | tempAdd =QString::fromUcs2(aItem->GetPersonalHomePage().GetBuffer()); | 649 | tempAdd =QString::fromUcs2(aItem->GetPersonalHomePage().GetBuffer()); |
650 | phoneS.replace( QRegExp("\\r"), ""); | ||
619 | if ( ! tempAdd.isEmpty() ) { | 651 | if ( ! tempAdd.isEmpty() ) { |
620 | additionalInfo += i18n("\nHomepage: "); | 652 | additionalInfo += i18n("\nHomepage: "); |
621 | additionalInfo += tempAdd;; | 653 | additionalInfo += tempAdd;; |
622 | } | 654 | } |
623 | tempAdd = QString::fromUcs2(aItem->GetBillingInformation().GetBuffer()); | 655 | tempAdd = QString::fromUcs2(aItem->GetBillingInformation().GetBuffer()); |
656 | phoneS.replace( QRegExp("\\r"), ""); | ||
624 | if ( ! tempAdd.isEmpty() ) { | 657 | if ( ! tempAdd.isEmpty() ) { |
625 | additionalInfo += i18n("\nBilling information: "); | 658 | additionalInfo += i18n("\nBilling information: "); |
626 | additionalInfo += tempAdd;; | 659 | additionalInfo += tempAdd;; |
627 | } | 660 | } |
628 | tempAdd = QString::fromUcs2(aItem->GetCustomerID().GetBuffer()); | 661 | tempAdd = QString::fromUcs2(aItem->GetCustomerID().GetBuffer()); |
662 | phoneS.replace( QRegExp("\\r"), ""); | ||
629 | if ( ! tempAdd.isEmpty() ) { | 663 | if ( ! tempAdd.isEmpty() ) { |
630 | additionalInfo += i18n("\nCustomer ID: "); | 664 | additionalInfo += i18n("\nCustomer ID: "); |
631 | additionalInfo += tempAdd;; | 665 | additionalInfo += tempAdd;; |
632 | } | 666 | } |
633 | tempAdd = QString::fromUcs2(aItem->GetUser1().GetBuffer()); | 667 | tempAdd = QString::fromUcs2(aItem->GetUser1().GetBuffer()); |
668 | phoneS.replace( QRegExp("\\r"), ""); | ||
634 | if ( ! tempAdd.isEmpty() ) { | 669 | if ( ! tempAdd.isEmpty() ) { |
635 | additionalInfo += i18n("\nUser1: "); | 670 | additionalInfo += i18n("\nUser1: "); |
636 | additionalInfo += tempAdd;; | 671 | additionalInfo += tempAdd;; |
637 | } | 672 | } |
638 | tempAdd = QString::fromUcs2(aItem->GetUser2().GetBuffer()); | 673 | tempAdd = QString::fromUcs2(aItem->GetUser2().GetBuffer()); |
674 | phoneS.replace( QRegExp("\\r"), ""); | ||
639 | if ( ! tempAdd.isEmpty() ) { | 675 | if ( ! tempAdd.isEmpty() ) { |
640 | additionalInfo += i18n("\nUser2: "); | 676 | additionalInfo += i18n("\nUser2: "); |
641 | additionalInfo += tempAdd;; | 677 | additionalInfo += tempAdd;; |
642 | } | 678 | } |
643 | tempAdd = QString::fromUcs2(aItem->GetUser3().GetBuffer()); | 679 | tempAdd = QString::fromUcs2(aItem->GetUser3().GetBuffer()); |
680 | phoneS.replace( QRegExp("\\r"), ""); | ||
644 | if ( ! tempAdd.isEmpty() ) { | 681 | if ( ! tempAdd.isEmpty() ) { |
645 | additionalInfo += i18n("\nUser3: "); | 682 | additionalInfo += i18n("\nUser3: "); |
646 | additionalInfo += tempAdd;; | 683 | additionalInfo += tempAdd;; |
647 | } | 684 | } |
648 | tempAdd = QString::fromUcs2(aItem->GetUser4().GetBuffer()); | 685 | tempAdd = QString::fromUcs2(aItem->GetUser4().GetBuffer()); |
686 | phoneS.replace( QRegExp("\\r"), ""); | ||
649 | if ( ! tempAdd.isEmpty() ) { | 687 | if ( ! tempAdd.isEmpty() ) { |
650 | additionalInfo += i18n("\nUser4: "); | 688 | additionalInfo += i18n("\nUser4: "); |
651 | additionalInfo += tempAdd;; | 689 | additionalInfo += tempAdd;; |
652 | } | 690 | } |
653 | if (!additionalInfo.isEmpty() ) { | 691 | if (!additionalInfo.isEmpty() ) { |
654 | tempAdd = notesStr; | 692 | tempAdd = notesStr; |
655 | notesStr = "+++++++++++++++++++++++++++\n"; | 693 | notesStr = "+++++++++++++++++++++++++++\n"; |
656 | notesStr += i18n("Additonal fields created\nby KA/Pi Outlook import:"); | 694 | notesStr += i18n("Additonal fields created\nby KA/Pi Outlook import:"); |
657 | notesStr += additionalInfo; | 695 | notesStr += additionalInfo; |
658 | notesStr += i18n("\nEnd additonal fields created\nby KA/Pi Outlook import!\n"); | 696 | notesStr += i18n("\nEnd additonal fields created\nby KA/Pi Outlook import!\n"); |
659 | notesStr += "+++++++++++++++++++++++++++\n"; | 697 | notesStr += "+++++++++++++++++++++++++++\n"; |
660 | notesStr += tempAdd; | 698 | notesStr += tempAdd; |
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp index 0a3c2d5..c0bde0d 100644 --- a/korganizer/koimportoldialog.cpp +++ b/korganizer/koimportoldialog.cpp | |||
@@ -22,24 +22,25 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qframe.h> | 25 | #include <qframe.h> |
26 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qprogressbar.h> | 28 | #include <qprogressbar.h> |
29 | #include <qwidgetstack.h> | 29 | #include <qwidgetstack.h> |
30 | #include <qdatetime.h> | 30 | #include <qdatetime.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <qhbox.h> | 33 | #include <qhbox.h> |
34 | #include <qregexp.h> | ||
34 | #include <qheader.h> | 35 | #include <qheader.h> |
35 | #include <qdatetime.h> | 36 | #include <qdatetime.h> |
36 | #include <qlistview.h> | 37 | #include <qlistview.h> |
37 | 38 | ||
38 | #include <kdebug.h> | 39 | #include <kdebug.h> |
39 | #include <klocale.h> | 40 | #include <klocale.h> |
40 | #include <kstandarddirs.h> | 41 | #include <kstandarddirs.h> |
41 | #include <kmessagebox.h> | 42 | #include <kmessagebox.h> |
42 | #include <kfiledialog.h> | 43 | #include <kfiledialog.h> |
43 | 44 | ||
44 | #include <libkdepim/categoryselectdialog.h> | 45 | #include <libkdepim/categoryselectdialog.h> |
45 | #include <libkdepim/kinputdialog.h> | 46 | #include <libkdepim/kinputdialog.h> |
@@ -241,25 +242,25 @@ void KOImportOLdialog::ol2kopiCalendar( _AppointmentItem * aItem, bool computeRe | |||
241 | KCal::Event* event = new KCal::Event(); | 242 | KCal::Event* event = new KCal::Event(); |
242 | if ( aItem->GetAllDayEvent() ){ | 243 | if ( aItem->GetAllDayEvent() ){ |
243 | event->setDtStart( QDateTime( mDdate2Qdtr( aItem->GetStart()).date(),QTime(0,0,0 ) )); | 244 | event->setDtStart( QDateTime( mDdate2Qdtr( aItem->GetStart()).date(),QTime(0,0,0 ) )); |
244 | event->setDtEnd( QDateTime( mDdate2Qdtr( aItem->GetEnd()) .date(),QTime(0,0,0 )).addDays(-1)); | 245 | event->setDtEnd( QDateTime( mDdate2Qdtr( aItem->GetEnd()) .date(),QTime(0,0,0 )).addDays(-1)); |
245 | event->setFloats( true ); | 246 | event->setFloats( true ); |
246 | } else { | 247 | } else { |
247 | event->setDtStart( mDdate2Qdtr( aItem->GetStart()) ); | 248 | event->setDtStart( mDdate2Qdtr( aItem->GetStart()) ); |
248 | event->setDtEnd( mDdate2Qdtr( aItem->GetEnd()) ); | 249 | event->setDtEnd( mDdate2Qdtr( aItem->GetEnd()) ); |
249 | event->setFloats( false ); | 250 | event->setFloats( false ); |
250 | } | 251 | } |
251 | event->setSummary( QString::fromUcs2( aItem->GetSubject().GetBuffer()) ); | 252 | event->setSummary( QString::fromUcs2( aItem->GetSubject().GetBuffer()) ); |
252 | event->setLocation( QString::fromUcs2( aItem->GetLocation().GetBuffer()) ); | 253 | event->setLocation( QString::fromUcs2( aItem->GetLocation().GetBuffer()) ); |
253 | event->setDescription( QString::fromUcs2( aItem->GetBody().GetBuffer()) ); | 254 | event->setDescription( QString::fromUcs2( aItem->GetBody().GetBuffer()).replace( QRegExp("\\r"), "") ); |
254 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); | 255 | QString cat = QString::fromUcs2( aItem->GetCategories().GetBuffer()); |
255 | event->setCategories( QStringList::split( ";", cat )); | 256 | event->setCategories( QStringList::split( ";", cat )); |
256 | if ( aItem->GetReminderSet() ) { | 257 | if ( aItem->GetReminderSet() ) { |
257 | event->clearAlarms(); | 258 | event->clearAlarms(); |
258 | Alarm* alarm = event->newAlarm(); | 259 | Alarm* alarm = event->newAlarm(); |
259 | alarm->setStartOffset( -aItem->GetReminderMinutesBeforeStart()*60 ); | 260 | alarm->setStartOffset( -aItem->GetReminderMinutesBeforeStart()*60 ); |
260 | alarm->setEnabled( true ); | 261 | alarm->setEnabled( true ); |
261 | if ( aItem->GetReminderPlaySound() ) { | 262 | if ( aItem->GetReminderPlaySound() ) { |
262 | alarm->setType( Alarm::Audio ); | 263 | alarm->setType( Alarm::Audio ); |
263 | alarm->setAudioFile( QString::fromUcs2( aItem->GetReminderSoundFile().GetBuffer())); | 264 | alarm->setAudioFile( QString::fromUcs2( aItem->GetReminderSoundFile().GetBuffer())); |
264 | } | 265 | } |
265 | else | 266 | else |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9e215b9..63484d6 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -279,43 +279,49 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
279 | infrared = 0; | 279 | infrared = 0; |
280 | #endif | 280 | #endif |
281 | 281 | ||
282 | mBRdisabled = false; | 282 | mBRdisabled = false; |
283 | toggleBeamReceive(); | 283 | toggleBeamReceive(); |
284 | } | 284 | } |
285 | MainWindow::~MainWindow() | 285 | MainWindow::~MainWindow() |
286 | { | 286 | { |
287 | //qDebug("MainWindow::~MainWindow() "); | 287 | //qDebug("MainWindow::~MainWindow() "); |
288 | //save toolbar location | 288 | //save toolbar location |
289 | delete mCalendar; | 289 | delete mCalendar; |
290 | delete mSyncManager; | 290 | delete mSyncManager; |
291 | #ifndef DESKTOP_VERSION | ||
291 | if ( infrared ) | 292 | if ( infrared ) |
292 | delete infrared; | 293 | delete infrared; |
294 | #endif | ||
293 | 295 | ||
294 | 296 | ||
295 | } | 297 | } |
296 | 298 | ||
297 | void MainWindow::disableBR(bool b) | 299 | void MainWindow::disableBR(bool b) |
298 | { | 300 | { |
301 | #ifndef DESKTOP_VERSION | ||
299 | if ( b ) { | 302 | if ( b ) { |
300 | if ( infrared ) { | 303 | if ( infrared ) { |
301 | toggleBeamReceive(); | 304 | toggleBeamReceive(); |
302 | mBRdisabled = true; | 305 | mBRdisabled = true; |
303 | } | 306 | } |
307 | mBRdisabled = true; | ||
304 | } else { | 308 | } else { |
305 | if ( mBRdisabled ) { | 309 | if ( mBRdisabled ) { |
306 | mBRdisabled = false; | 310 | mBRdisabled = false; |
307 | toggleBeamReceive(); | 311 | //makes no sense,because other cal ap is probably running |
312 | // toggleBeamReceive(); | ||
308 | } | 313 | } |
309 | } | 314 | } |
315 | #endif | ||
310 | 316 | ||
311 | } | 317 | } |
312 | bool MainWindow::beamReceiveEnabled() | 318 | bool MainWindow::beamReceiveEnabled() |
313 | { | 319 | { |
314 | #ifndef DESKTOP_VERSION | 320 | #ifndef DESKTOP_VERSION |
315 | return ( infrared != 0 ); | 321 | return ( infrared != 0 ); |
316 | #endif | 322 | #endif |
317 | return false; | 323 | return false; |
318 | } | 324 | } |
319 | 325 | ||
320 | void MainWindow::toggleBeamReceive() | 326 | void MainWindow::toggleBeamReceive() |
321 | { | 327 | { |