phonebookui/pbkcommonui/src/cntphonenumbermodel.cpp
changeset 40 b46a585f6909
parent 31 2a11b5b00470
child 46 efe85016a067
--- a/phonebookui/pbkcommonui/src/cntphonenumbermodel.cpp	Thu May 27 12:45:19 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntphonenumbermodel.cpp	Fri Jun 11 13:29:23 2010 +0300
@@ -90,4 +90,19 @@
     {
     }
 
+QContactDetail CntPhoneNumberModel::detail() const 
+{
+    QListIterator<QContactPhoneNumber> numberList(mContact->details<QContactPhoneNumber>());
+    numberList.toBack(); // go through backwards, so the newest item will be returned
+    while ( numberList.hasPrevious() )
+    {
+        QContactPhoneNumber number = numberList.previous();
+        if ( !number.value(QContactPhoneNumber::FieldNumber).isEmpty() )
+        {
+            return number;
+        }
+    }
+    return QContactPhoneNumber(); // return empty address if none found
+}
+
 // End of File