locationdataharvester/mylocationsdatabasemanager/src/mylocationsdatabasemanager.cpp
changeset 35 59575560d1e6
parent 30 96df3ab41000
child 41 b3dd5ec3089d
equal deleted inserted replaced
31:8db05346071b 35:59575560d1e6
   478                     if( !lookupItem.mIsDuplicate )
   478                     if( !lookupItem.mIsDuplicate )
   479                     {
   479                     {
   480                         // if current lookup item duplicate property is 0, then remove next corresponding
   480                         // if current lookup item duplicate property is 0, then remove next corresponding
   481                         // calendar lookup entry duplicate property.
   481                         // calendar lookup entry duplicate property.
   482                         // this is required because the current entry will be pointing to a new landmark.
   482                         // this is required because the current entry will be pointing to a new landmark.
   483                         UnsetDuplicateNextCalEntry( existingLandmark->LandmarkId() );
   483                         UnsetDuplicateNextCalEntry( aUid, existingLandmark->LandmarkId() );
   484                     } 
   484                     } 
   485 
   485 
   486                     // set duplicate only if there are calendar entries already pointing to this landmark. 
   486                     // set duplicate only if there are calendar entries already pointing to this landmark. 
   487                     if( IsDuplicateEntry( dupLmId ) )
   487                     if( IsDuplicateEntry( dupLmId ) )
   488                     {
   488                     {
   505                     if( !lookupItem.mIsDuplicate )
   505                     if( !lookupItem.mIsDuplicate )
   506                     {
   506                     {
   507                         // if current lookup item duplicate property is 0, then remove next corresponding
   507                         // if current lookup item duplicate property is 0, then remove next corresponding
   508                         // calendar lookup entry duplicate property.
   508                         // calendar lookup entry duplicate property.
   509                         // this is required because the current entry will be pointing to a new landmark.
   509                         // this is required because the current entry will be pointing to a new landmark.
   510                         UnsetDuplicateNextCalEntry( existingLandmark->LandmarkId() );
   510                         UnsetDuplicateNextCalEntry( aUid, existingLandmark->LandmarkId() );
   511                     } 
   511                     } 
   512                 }
   512                 }
   513                 
   513                 
   514                 lookupItem.mIsDuplicate = 0;
   514                 lookupItem.mIsDuplicate = 0;
   515                 // update the lookup table
   515                 // update the lookup table
   857 {
   857 {
   858     __TRACE_CALLSTACK;
   858     __TRACE_CALLSTACK;
   859     TPtrC tempStr;
   859     TPtrC tempStr;
   860     TInt retStatus;
   860     TInt retStatus;
   861     TBool addressEmtpy = ETrue;
   861     TBool addressEmtpy = ETrue;
       
   862     aLandmarkAddress.Copy( KNullDesC );
   862     retStatus = aLandmark->GetPositionField(EPositionFieldStreet, tempStr);
   863     retStatus = aLandmark->GetPositionField(EPositionFieldStreet, tempStr);
   863     if (retStatus == KErrNone && tempStr.Length())
   864     if (retStatus == KErrNone && tempStr.Length())
   864     {
   865     {
   865         {
   866         {
   866             aLandmarkAddress.Copy(tempStr);
   867             aLandmarkAddress.Copy(tempStr);
  1001 
  1002 
  1002 // -----------------------------------------------------------------------------
  1003 // -----------------------------------------------------------------------------
  1003 // CMyLocationsDatabaseManager::UnsetDuplicateNextCalEntry()
  1004 // CMyLocationsDatabaseManager::UnsetDuplicateNextCalEntry()
  1004 // -----------------------------------------------------------------------------
  1005 // -----------------------------------------------------------------------------
  1005 //
  1006 //
  1006 void CMyLocationsDatabaseManager::UnsetDuplicateNextCalEntry( quint32 aLandmarkId )
  1007 void CMyLocationsDatabaseManager::UnsetDuplicateNextCalEntry( quint32 aUid, quint32 aLandmarkId )
  1007 {
  1008 {
  1008     __TRACE_CALLSTACK;
  1009     __TRACE_CALLSTACK;
  1009     // get next duplicate item
  1010     // get next duplicate item
  1010     QList<QLookupItem> itemArray;
  1011     QList<QLookupItem> itemArray;
  1011     iLocationAppLookupDb->findEntriesByLandmarkId( aLandmarkId, itemArray );
  1012     iLocationAppLookupDb->findEntriesByLandmarkId( aLandmarkId, itemArray );
  1012     for ( int i = 0; i < itemArray.count(); i++)
  1013     for ( int i = 0; i < itemArray.count(); i++)
  1013     {
  1014     {
  1014         if( itemArray[i].mSourceType == ESourceCalendar )
  1015         if( itemArray[i].mSourceType == ESourceCalendar && itemArray[i].mSourceUid != aUid )
  1015         {
  1016         {
  1016             itemArray[i].mIsDuplicate = 0;
  1017             itemArray[i].mIsDuplicate = 0;
  1017             iLocationAppLookupDb->updateEntryById( itemArray[i] );
  1018             iLocationAppLookupDb->updateEntryById( itemArray[i] );
  1018             break;
  1019             break;
  1019         }
  1020         }
  1093 {
  1094 {
  1094     __TRACE_CALLSTACK;
  1095     __TRACE_CALLSTACK;
  1095     QString filePath = QString( (QChar*)aFilePath.Ptr(), aFilePath.Length() );
  1096     QString filePath = QString( (QChar*)aFilePath.Ptr(), aFilePath.Length() );
  1096     iLocationAppLookupDb->updateMaptileBySourceIdAndType( aSourceId, aSourceType, filePath );
  1097     iLocationAppLookupDb->updateMaptileBySourceIdAndType( aSourceId, aSourceType, filePath );
  1097 }
  1098 }
       
  1099 
       
  1100 // -----------------------------------------------------------------------------
       
  1101 // CMyLocationsDatabaseManager::UpdateEntryName()
       
  1102 // -----------------------------------------------------------------------------
       
  1103 //
       
  1104 EXPORT_C void CMyLocationsDatabaseManager::UpdateEntryName( TUint32 aSourceId, TUidSourceType aSourceType, 
       
  1105                                             const TDesC& aName )
       
  1106 {
       
  1107     __TRACE_CALLSTACK;
       
  1108     QString name = QString( (QChar*)aName.Ptr(), aName.Length() );
       
  1109     iLocationAppLookupDb->updateEntryNameByIdAndType( aSourceId, aSourceType, name );
       
  1110 	
       
  1111 }
       
  1112 
  1098 
  1113 
  1099 // -----------------------------------------------------------------------------
  1114 // -----------------------------------------------------------------------------
  1100 // CMyLocationsDatabaseManager::CheckIfAddressChanged()
  1115 // CMyLocationsDatabaseManager::CheckIfAddressChanged()
  1101 // -----------------------------------------------------------------------------
  1116 // -----------------------------------------------------------------------------
  1102 //
  1117 //