phonebookui/pbkcommonui/src/cntnoteeditormodel.cpp
changeset 46 efe85016a067
parent 40 b46a585f6909
--- a/phonebookui/pbkcommonui/src/cntnoteeditormodel.cpp	Fri Jun 11 13:29:23 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntnoteeditormodel.cpp	Wed Jun 23 18:02:44 2010 +0300
@@ -36,6 +36,7 @@
 void CntNoteEditorModel::insertDetailField()
 {
     QContactNote emptyNote;
+    mNoteList.append( emptyNote );
     appendDataFormItem( new CntDetailModelItem(emptyNote), invisibleRootItem() );
 }
 
@@ -46,10 +47,14 @@
     int count( root->childCount() );
     for ( int i(0); i < count; i++ ) {
         CntDetailModelItem* detail = static_cast<CntDetailModelItem*>( root->childAt(i) );
-        QContactDetail note = detail->detail();
-        mContact->saveDetail( &note );
+        QContactNote note = detail->detail();
         
-        if ( note.value(QContactNote::FieldNote).isEmpty() )
+        if ( !mNoteList.contains(note) )
+        {
+            mContact->saveDetail( &note );
+        }
+        
+        if ( note.note().isEmpty() )
         {
             mContact->removeDetail( &note );
         }