author | zautrix <zautrix> | 2004-10-09 02:22:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-09 02:22:11 (UTC) |
commit | 69af2ac56474e3a1e3e59be318caf53f5d357f94 (patch) (unidiff) | |
tree | 05e8a657c6f2526f5d1d628e93e0f16e8ffbf11e | |
parent | c2165f4e14bc2f7ab2ef19f5c35497dde5e87a0d (diff) | |
download | kdepimpi-69af2ac56474e3a1e3e59be318caf53f5d357f94.zip kdepimpi-69af2ac56474e3a1e3e59be318caf53f5d357f94.tar.gz kdepimpi-69af2ac56474e3a1e3e59be318caf53f5d357f94.tar.bz2 |
more ir fixes
-rw-r--r-- | kabc/addressbook.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index bf6d053..1a06956 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -398,33 +398,32 @@ void AddressBook::export2File( QString fileName ) | |||
398 | //Resource *resource() const; | 398 | //Resource *resource() const; |
399 | converter.addresseeToVCard( *it, vcard, version ); | 399 | converter.addresseeToVCard( *it, vcard, version ); |
400 | t << vcard << "\r\n"; | 400 | t << vcard << "\r\n"; |
401 | } | 401 | } |
402 | t << "\r\n\r\n"; | 402 | t << "\r\n\r\n"; |
403 | outFile.close(); | 403 | outFile.close(); |
404 | } | 404 | } |
405 | void AddressBook::importFromFile( QString fileName, bool replaceLabel ) | 405 | void AddressBook::importFromFile( QString fileName, bool replaceLabel ) |
406 | { | 406 | { |
407 | 407 | ||
408 | KABC::Addressee::List list; | 408 | KABC::Addressee::List list; |
409 | QFile file( fileName ); | 409 | QFile file( fileName ); |
410 | 410 | ||
411 | file.open( IO_ReadOnly ); | 411 | file.open( IO_ReadOnly ); |
412 | QByteArray rawData = file.readAll(); | 412 | QByteArray rawData = file.readAll(); |
413 | file.close(); | 413 | file.close(); |
414 | qDebug("AddressBook::importFromFile "); | ||
415 | QString data; | 414 | QString data; |
416 | if ( replaceLabel ) { | 415 | if ( replaceLabel ) { |
417 | data = QString::fromLatin1( rawData.data(), rawData.size() + 1 ); | 416 | data = QString::fromLatin1( rawData.data(), rawData.size() + 1 ); |
418 | data.replace ( QRegExp("LABEL") , "ADR" ); | 417 | data.replace ( QRegExp("LABEL") , "ADR" ); |
419 | data.replace ( QRegExp("CHARSET=ISO-8859-1") , "" ); | 418 | data.replace ( QRegExp("CHARSET=ISO-8859-1") , "" ); |
420 | } else | 419 | } else |
421 | data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); | 420 | data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); |
422 | KABC::VCardTool tool; | 421 | KABC::VCardTool tool; |
423 | list = tool.parseVCards( data ); | 422 | list = tool.parseVCards( data ); |
424 | KABC::Addressee::List::Iterator it; | 423 | KABC::Addressee::List::Iterator it; |
425 | for ( it = list.begin(); it != list.end(); ++it ) { | 424 | for ( it = list.begin(); it != list.end(); ++it ) { |
426 | (*it).setResource( 0 ); | 425 | (*it).setResource( 0 ); |
427 | if ( replaceLabel ) | 426 | if ( replaceLabel ) |
428 | (*it).removeVoice(); | 427 | (*it).removeVoice(); |
429 | insertAddressee( (*it), false, true ); | 428 | insertAddressee( (*it), false, true ); |
430 | } | 429 | } |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 3a542ba..efcd492 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -314,34 +314,35 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
314 | 314 | ||
315 | KABCore::~KABCore() | 315 | KABCore::~KABCore() |
316 | { | 316 | { |
317 | // save(); | 317 | // save(); |
318 | //saveSettings(); | 318 | //saveSettings(); |
319 | //KABPrefs::instance()->writeConfig(); | 319 | //KABPrefs::instance()->writeConfig(); |
320 | delete AddresseeConfig::instance(); | 320 | delete AddresseeConfig::instance(); |
321 | mAddressBook = 0; | 321 | mAddressBook = 0; |
322 | KABC::StdAddressBook::close(); | 322 | KABC::StdAddressBook::close(); |
323 | 323 | ||
324 | delete syncManager; | 324 | delete syncManager; |
325 | 325 | ||
326 | } | 326 | } |
327 | 327 | ||
328 | void KABCore::recieve( QString fn ) | 328 | void KABCore::recieve( QString fn ) |
329 | { | 329 | { |
330 | qDebug("KABCore::recieve "); | 330 | //qDebug("KABCore::recieve "); |
331 | mAddressBook->importFromFile( fn, true ); | 331 | mAddressBook->importFromFile( fn, true ); |
332 | mViewManager->refreshView(); | ||
332 | topLevelWidget()->raise(); | 333 | topLevelWidget()->raise(); |
333 | } | 334 | } |
334 | void KABCore::restoreSettings() | 335 | void KABCore::restoreSettings() |
335 | { | 336 | { |
336 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 337 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
337 | 338 | ||
338 | bool state; | 339 | bool state; |
339 | 340 | ||
340 | if (mMultipleViewsAtOnce) | 341 | if (mMultipleViewsAtOnce) |
341 | state = KABPrefs::instance()->mDetailsPageVisible; | 342 | state = KABPrefs::instance()->mDetailsPageVisible; |
342 | else | 343 | else |
343 | state = false; | 344 | state = false; |
344 | 345 | ||
345 | mActionDetails->setChecked( state ); | 346 | mActionDetails->setChecked( state ); |
346 | setDetailsVisible( state ); | 347 | setDetailsVisible( state ); |
347 | 348 | ||