summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-01-16 22:15:04 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-01-16 22:15:04 (GMT)
commit34d3e8edb4c655360e8c464819d1c438ac23b2f9 (patch)
treec1a2c5d5e70d1ec05f1d6299376e5e2a437296fc
parent4e5f62680471ed1420438d7db51a31bca1ec8a64 (diff)
downloadkolab-utils-34d3e8edb4c655360e8c464819d1c438ac23b2f9.tar.gz
Generate a new RFC4122 compliant UID for contacts.
The supplied UID is useless and RFC4122 compliance is preferred.
-rw-r--r--migrationutility/googlesourceaccount.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/migrationutility/googlesourceaccount.cpp b/migrationutility/googlesourceaccount.cpp
index 5a54fe8..7e7ba22 100644
--- a/migrationutility/googlesourceaccount.cpp
+++ b/migrationutility/googlesourceaccount.cpp
@@ -29,6 +29,7 @@
#include <libkgapi2/tasks/tasklist.h>
#include <libkgapi2/authjob.h>
#include <libkgapi2/account.h>
+#include <quuid.h>
#include <errorhandler.h>
@@ -139,7 +140,10 @@ KGAPI2::FetchJob* FetchContactObjectsJob::getFetchJob(const KGAPI2::AccountPtr&
Object FetchContactObjectsJob::getObject(const KGAPI2::ObjectPtr& object)
{
- const KABC::Addressee contact = *object.dynamicCast<KGAPI2::Contact>();
+ KABC::Addressee contact = *object.dynamicCast<KGAPI2::Contact>();
+ //The returned uid's are of format: http://www.google.com/m8/feeds/contacts/NAME%40gmail.com/base/21042a1f892367ee
+ //We generate a new one that is RFC4122 compliant to avoid incompatibilities
+ contact.setUid( QUuid::createUuid().toString().mid(1, 36) );
// Debug() << "contact: " << contact.name();
// qDebug() << contact.emails();
Object obj;