author | zautrix <zautrix> | 2004-07-05 14:16:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-05 14:16:54 (UTC) |
commit | 9a90061115ee2cac8adc5b2d21e607b6c5c9b890 (patch) (side-by-side diff) | |
tree | 87efb03b00559f3a7fbb5c693d6d7b734f0d1eb7 /kaddressbook/undocmds.cpp | |
parent | af75333f69c6b7284a7fbe7ab63c08e10ae4541b (diff) | |
download | kdepimpi-9a90061115ee2cac8adc5b2d21e607b6c5c9b890.zip kdepimpi-9a90061115ee2cac8adc5b2d21e607b6c5c9b890.tar.gz kdepimpi-9a90061115ee2cac8adc5b2d21e607b6c5c9b890.tar.bz2 |
Improved pasting of many items
-rw-r--r-- | kaddressbook/undocmds.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kaddressbook/undocmds.cpp b/kaddressbook/undocmds.cpp index db773be..5fbeec3 100644 --- a/kaddressbook/undocmds.cpp +++ b/kaddressbook/undocmds.cpp @@ -95,53 +95,54 @@ PwPasteCommand::PwPasteCommand( KABCore *core, const KABC::Addressee::List &list QString PwPasteCommand::name() { return i18n( "Paste" ); } void PwPasteCommand::undo() { KABC::Addressee::List::Iterator it; for ( it = mAddresseeList.begin(); it != mAddresseeList.end(); ++it ) mCore->addressBook()->removeAddressee( *it ); } void PwPasteCommand::redo() { QStringList uids; KABC::Addressee::List::Iterator it; for ( it = mAddresseeList.begin(); it != mAddresseeList.end(); ++it ) { /* we have to set a new uid for the contact, otherwise insertAddressee() ignore it. */ (*it).setUid( KApplication::randomString( 10 ) ); uids.append( (*it).uid() ); mCore->addressBook()->insertAddressee( *it ); } - + if ( uids.count() < 4 ) { QStringList::Iterator uidIt; for ( uidIt = uids.begin(); uidIt != uids.end(); ++uidIt ) mCore->editContact( *uidIt ); } +} ///////////////////////////////// // PwNew Methods PwNewCommand::PwNewCommand( KABC::AddressBook *doc, const KABC::Addressee &a ) : Command(), mDocument( doc ), mA( a ) { mDocument->insertAddressee(mA); } PwNewCommand::~PwNewCommand() { } QString PwNewCommand::name() { return i18n( "New Contact" ); } void PwNewCommand::undo() { mDocument->removeAddressee( mA ); } |