From 9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 17 Aug 2005 14:48:16 +0000 Subject: kapi dlete conf --- (limited to 'kaddressbook/kabcore.cpp') diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index d5de9cb..b9830b1 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1028,7 +1028,23 @@ void KABCore::deleteContacts() void KABCore::deleteContacts( const QStringList &uids ) { + if ( uids.count() > 0 ) { + + if ( KABPrefs::instance()->mAskForDelete ) { + int count = uids.count(); + if ( count > 5 ) count = 5; + QString cNames; + int i; + for ( i = 0; i < count ; ++i ) { + cNames += KGlobal::formatMessage( mAddressBook->findByUid( uids[i] ).realName() ,0) + "\n"; + } + if ( uids.count() > 5 ) + cNames += i18n("...and %1 more\ncontact(s) selected").arg( uids.count() - 5 ); + QString text = i18n( "Do you really\nwant to delete the\nsetected contact(s)?\n\n" ) + cNames ; + if ( KMessageBox::questionYesNo( this, text ) != KMessageBox::Yes ) + return; + } PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); UndoStack::instance()->push( command ); RedoStack::instance()->clear(); @@ -1098,7 +1114,7 @@ void KABCore::setWhoAmI() } QString text( i18n( "Do you really want to use %1 as your new personal contact?" ) ); - if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) + if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].realName() ) ) == KMessageBox::Yes ) static_cast( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); } void KABCore::editCategories() @@ -2666,7 +2682,7 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString anniversaryList.append(anni); //should be ISODate realNameList.append((*it).realName()); preferredEmailList.append((*it).preferredEmail()); - assembledNameList.append((*it).assembledName()); + assembledNameList.append((*it).realName()); uidList.append((*it).uid()); //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); -- cgit v0.9.0.2