-rw-r--r-- | kaddressbook/kabcore.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 42e147f..d970ff1 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2353,17 +2353,27 @@ void KABCore::removeVoice() | |||
2353 | { | 2353 | { |
2354 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) | 2354 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) |
2355 | return; | 2355 | return; |
2356 | KABC::Addressee::List list; | ||
2357 | XXPortSelectDialog dlg( this, false, this ); | 2356 | XXPortSelectDialog dlg( this, false, this ); |
2358 | if ( dlg.exec() ) | 2357 | if ( !dlg.exec() ) |
2359 | list = dlg.contacts(); | ||
2360 | else | ||
2361 | return; | 2358 | return; |
2362 | KABC::Addressee::List::Iterator it; | 2359 | mAddressBook->setUntagged(); |
2363 | for ( it = list.begin(); it != list.end(); ++it ) { | 2360 | dlg.tagSelected(); |
2364 | if ( (*it).removeVoice() ) | 2361 | message(i18n("Removing voice..."), false ); |
2365 | addrModified((*it), false ); | 2362 | KABC::AddressBook::Iterator it; |
2363 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | ||
2364 | if ( (*it).tagged() ) { | ||
2365 | (*it).removeVoice(); | ||
2366 | } | ||
2366 | } | 2367 | } |
2368 | message(i18n("Refreshing view...") ); | ||
2369 | qApp->processEvents(); | ||
2370 | mViewManager->refreshView( "" ); | ||
2371 | Addressee add; | ||
2372 | mDetails->setAddressee( add ); | ||
2373 | message(i18n("Remove voice completed!") ); | ||
2374 | |||
2375 | |||
2376 | |||
2367 | } | 2377 | } |
2368 | 2378 | ||
2369 | void KABCore::setFormattedName() | 2379 | void KABCore::setFormattedName() |
@@ -3131,7 +3141,7 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
3131 | AddressBook abLocal(filename,"syncContact"); | 3141 | AddressBook abLocal(filename,"syncContact"); |
3132 | bool syncOK = false; | 3142 | bool syncOK = false; |
3133 | if ( abLocal.load() ) { | 3143 | if ( abLocal.load() ) { |
3134 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); | 3144 | qDebug("Sync:AB loaded %s,sync mode %d",filename.latin1(), mode ); |
3135 | bool external = false; | 3145 | bool external = false; |
3136 | bool isXML = false; | 3146 | bool isXML = false; |
3137 | if ( filename.right(4) == ".xml") { | 3147 | if ( filename.right(4) == ".xml") { |
@@ -3141,7 +3151,7 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
3141 | } else { | 3151 | } else { |
3142 | external = !manager->mIsKapiFile; | 3152 | external = !manager->mIsKapiFile; |
3143 | if ( external ) { | 3153 | if ( external ) { |
3144 | qDebug("Setting vcf mode to external "); | 3154 | qDebug("Sync:Setting vcf mode to external "); |
3145 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3155 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3146 | AddressBook::Iterator it; | 3156 | AddressBook::Iterator it; |
3147 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 3157 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
@@ -3161,7 +3171,7 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
3161 | { | 3171 | { |
3162 | if ( external ) | 3172 | if ( external ) |
3163 | abLocal.removeSyncAddressees( !isXML); | 3173 | abLocal.removeSyncAddressees( !isXML); |
3164 | qDebug("Saving remote AB "); | 3174 | qDebug("Sync:Saving remote AB "); |
3165 | if ( ! abLocal.saveAB()) | 3175 | if ( ! abLocal.saveAB()) |
3166 | qDebug("Error writing back AB to file "); | 3176 | qDebug("Error writing back AB to file "); |
3167 | if ( external ) { | 3177 | if ( external ) { |