locationdataharvester/mylocationsdatabasemanager/src/mylocationsdatabasemanager.cpp
changeset 35 59575560d1e6
parent 30 96df3ab41000
child 41 b3dd5ec3089d
--- a/locationdataharvester/mylocationsdatabasemanager/src/mylocationsdatabasemanager.cpp	Tue Jul 06 14:10:28 2010 +0300
+++ b/locationdataharvester/mylocationsdatabasemanager/src/mylocationsdatabasemanager.cpp	Wed Aug 18 09:43:18 2010 +0300
@@ -480,7 +480,7 @@
                         // if current lookup item duplicate property is 0, then remove next corresponding
                         // calendar lookup entry duplicate property.
                         // this is required because the current entry will be pointing to a new landmark.
-                        UnsetDuplicateNextCalEntry( existingLandmark->LandmarkId() );
+                        UnsetDuplicateNextCalEntry( aUid, existingLandmark->LandmarkId() );
                     } 
 
                     // set duplicate only if there are calendar entries already pointing to this landmark. 
@@ -507,7 +507,7 @@
                         // if current lookup item duplicate property is 0, then remove next corresponding
                         // calendar lookup entry duplicate property.
                         // this is required because the current entry will be pointing to a new landmark.
-                        UnsetDuplicateNextCalEntry( existingLandmark->LandmarkId() );
+                        UnsetDuplicateNextCalEntry( aUid, existingLandmark->LandmarkId() );
                     } 
                 }
                 
@@ -859,6 +859,7 @@
     TPtrC tempStr;
     TInt retStatus;
     TBool addressEmtpy = ETrue;
+    aLandmarkAddress.Copy( KNullDesC );
     retStatus = aLandmark->GetPositionField(EPositionFieldStreet, tempStr);
     if (retStatus == KErrNone && tempStr.Length())
     {
@@ -1003,7 +1004,7 @@
 // CMyLocationsDatabaseManager::UnsetDuplicateNextCalEntry()
 // -----------------------------------------------------------------------------
 //
-void CMyLocationsDatabaseManager::UnsetDuplicateNextCalEntry( quint32 aLandmarkId )
+void CMyLocationsDatabaseManager::UnsetDuplicateNextCalEntry( quint32 aUid, quint32 aLandmarkId )
 {
     __TRACE_CALLSTACK;
     // get next duplicate item
@@ -1011,7 +1012,7 @@
     iLocationAppLookupDb->findEntriesByLandmarkId( aLandmarkId, itemArray );
     for ( int i = 0; i < itemArray.count(); i++)
     {
-        if( itemArray[i].mSourceType == ESourceCalendar )
+        if( itemArray[i].mSourceType == ESourceCalendar && itemArray[i].mSourceUid != aUid )
         {
             itemArray[i].mIsDuplicate = 0;
             iLocationAppLookupDb->updateEntryById( itemArray[i] );
@@ -1097,6 +1098,20 @@
 }
 
 // -----------------------------------------------------------------------------
+// CMyLocationsDatabaseManager::UpdateEntryName()
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMyLocationsDatabaseManager::UpdateEntryName( TUint32 aSourceId, TUidSourceType aSourceType, 
+                                            const TDesC& aName )
+{
+    __TRACE_CALLSTACK;
+    QString name = QString( (QChar*)aName.Ptr(), aName.Length() );
+    iLocationAppLookupDb->updateEntryNameByIdAndType( aSourceId, aSourceType, name );
+	
+}
+
+
+// -----------------------------------------------------------------------------
 // CMyLocationsDatabaseManager::CheckIfAddressChanged()
 // -----------------------------------------------------------------------------
 //