summaryrefslogtreecommitdiffabout
path: root/kaddressbook/undocmds.cpp
authorzautrix <zautrix>2004-07-12 12:43:54 (UTC)
committer zautrix <zautrix>2004-07-12 12:43:54 (UTC)
commitcbc789907408fa3359444c464ba5a86be892f301 (patch) (side-by-side diff)
tree82d02fc50134c1e64acf4ea9f5388ac3396602b3 /kaddressbook/undocmds.cpp
parenta55fa40fa32b115c7f7803fb6af0da5184cd7dff (diff)
downloadkdepimpi-cbc789907408fa3359444c464ba5a86be892f301.zip
kdepimpi-cbc789907408fa3359444c464ba5a86be892f301.tar.gz
kdepimpi-cbc789907408fa3359444c464ba5a86be892f301.tar.bz2
Windows import fixes
Diffstat (limited to 'kaddressbook/undocmds.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/undocmds.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/kaddressbook/undocmds.cpp b/kaddressbook/undocmds.cpp
index 5fbeec3..5807dc0 100644
--- a/kaddressbook/undocmds.cpp
+++ b/kaddressbook/undocmds.cpp
@@ -27,25 +27,25 @@
#include <qclipboard.h>
#include <klocale.h>
#include <kdebug.h>
#include <kapplication.h>
#include <kabc/addressbook.h>
#include "addresseeutil.h"
#include "addresseeconfig.h"
#include "kabcore.h"
#include "undocmds.h"
-
+extern bool pasteWithNewUid;
/////////////////////////////////
// PwDelete Methods
PwDeleteCommand::PwDeleteCommand(KABC::AddressBook *doc,
const QStringList &uidList)
: Command(), mDocument(doc), mAddresseeList(), mUidList(uidList)
{
redo();
}
PwDeleteCommand::~PwDeleteCommand()
{
@@ -103,25 +103,26 @@ void PwPasteCommand::undo()
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 ) );
+ if ( pasteWithNewUid )
+ (*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