diff -r bab96b7ed1a4 -r f39ed5e045e0 phoneengine/phonecntfinder2/src/cphcntmatch2.cpp --- a/phoneengine/phonecntfinder2/src/cphcntmatch2.cpp Tue Jun 15 14:14:38 2010 +0100 +++ b/phoneengine/phonecntfinder2/src/cphcntmatch2.cpp Thu Jul 22 16:33:21 2010 +0100 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include "cphcntmatch2.h" @@ -31,7 +32,7 @@ // --------------------------------------------------------------------------- // CPhCntMatch2::CPhCntMatch2(const QContact aContact): -iContact(aContact), iNumber(NULL), iContactId(NULL), iDummyArray(NULL) +iContact(aContact), iNumber(NULL), iContactId(NULL), iDTMFArray(NULL) { } @@ -42,7 +43,7 @@ CPhCntMatch2::~CPhCntMatch2() { delete iNumber; - delete iDummyArray; + delete iDTMFArray; delete iContactId; } @@ -85,25 +86,7 @@ // MPhCntMatch::TNumberType CPhCntMatch2::NumberType() const { - - MPhCntMatch::TNumberType valueToReturn = MPhCntMatch::EMobileNumber; - /* -> TODO not yet supported - switch (iContact->field(fieldNumber).property()) - { - case propertyMobile: - { - valueToReturn = MPhCntMatch::EMobileNumber; - break; - } - default: - { - valueToReturn = MPhCntMatch::ENone; - } - - }//switch - */ - - return valueToReturn; + return MPhCntMatch::ENone; } // ----------------------------------------------------------------------------- @@ -122,7 +105,7 @@ // TPtrC CPhCntMatch2::FirstName() const { - return FieldValue(QContactName::DefinitionName, QContactName::FieldFirst); + return iFirstname.utf16(); } // ----------------------------------------------------------------------------- @@ -131,7 +114,7 @@ // TPtrC CPhCntMatch2::LastName() const { - return FieldValue(QContactName::DefinitionName, QContactName::FieldLast); + return iLastname.utf16(); } // ----------------------------------------------------------------------------- @@ -148,10 +131,14 @@ // TPtrC CPhCntMatch2::Number() const { -//how many numbers are returned here? should be only one that matched - return iNumber? iNumber->Des() : - FieldValue(QContactPhoneNumber::DefinitionName, - QContactPhoneNumber::FieldNumber); + //how many numbers are returned here? should be only one that matched + if ( iNumber == NULL ) { + + TPtrC ptr(FieldValue(QContactPhoneNumber::DefinitionName, + QContactPhoneNumber::FieldNumber).utf16()); + const_cast(iNumber) = ptr.Alloc(); + } + return iNumber->Des(); } // ----------------------------------------------------------------------------- // PersonalRingingTone @@ -159,20 +146,7 @@ // TPtrC CPhCntMatch2::PersonalRingingTone() const { - /* - //TODO - QString returnValue; - QList details = iContact.details(); - - for (int i=0;i details = iContact.details(); - - for (int i=0;i details = iContact.details(); + for (int i=0;i(); + iPersonalRingtone = ringtonedetail.audioRingtoneUrl().toString(); + PHONE_DEBUG2("CPhCntMatch2::personalRingingtone:: value is :", iPersonalRingtone); + } // ----------------------------------------------------------------------------- // FieldValue // ----------------------------------------------------------------------------- // -TPtrC CPhCntMatch2::FieldValue(const QString& name, const QString& key) const +QString CPhCntMatch2::FieldValue(const QString& name, const QString& key) const { QString returnValue; QList details = iContact.details(name); @@ -268,7 +259,7 @@ returnValue = details.first().value(key); } PHONE_DEBUG4("CPhCntMatch2::FieldValue:: key is :", key, "..value is :", returnValue); - return returnValue.utf16(); + return returnValue; }