From 9d31a7b316cf197ec3c250601f69c664c702f4f4 Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Fri, 30 Jan 2009 15:41:42 -0400 Subject: [PATCH] Using qPrintable to get the 'char *' string from QString (it really is just a macro to "str.toLocal8Bit().constData() " but is a shortcut anyway). --- googledataresource.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/googledataresource.cpp b/googledataresource.cpp index 17875ac..66dbeb6 100644 --- a/googledataresource.cpp +++ b/googledataresource.cpp @@ -147,7 +147,6 @@ void googledataResource::itemAdded( const Akonadi::Item &item, const Akonadi::Co KABC::Addressee addressee; gcal_contact_t contact; QString temp; - QByteArray ugly; int result; if (item.hasPayload()) @@ -160,12 +159,10 @@ void googledataResource::itemAdded( const Akonadi::Item &item, const Akonadi::Co * What about the good and old .c_str()? */ temp = addressee.realName(); - ugly = temp.toAscii(); - gcal_contact_set_title(contact, const_cast(ugly.constData())); + gcal_contact_set_title(contact, const_cast(qPrintable(temp))); temp = addressee.fullEmail(); - ugly = temp.toAscii(); - gcal_contact_set_email(contact, const_cast(ugly.constData())); + gcal_contact_set_email(contact, const_cast(qPrintable(temp))); /* TODO: add remaining fields */ -- 2.11.4.GIT