browserui/browser/FavouritesSrc/BrowserFavouritesModel.cpp
branchRCL_3
changeset 63 4baee4f15982
parent 32 92a061761a7b
equal deleted inserted replaced
62:5a044f6358c2 63:4baee4f15982
   792                     err = iDb.SetLastVisited( aItem );
   792                     err = iDb.SetLastVisited( aItem );
   793                     break;
   793                     break;
   794                     }
   794                     }
   795 
   795 
   796                 case KFavouritesNullUid:
   796                 case KFavouritesNullUid:
       
   797                 default: 
   797                     {
   798                     {
   798                     // Check first if the item added has the same name as any of the special folders
   799                     // Check first if the item added has the same name as any of the special folders
   799                     
   800                     
   800                     TBool itemExists = EFalse;
   801                     TBool itemExists = EFalse;
   801                     if (aItem.Type() == CFavouritesItem::EFolder)
   802                     if (aItem.Type() == CFavouritesItem::EFolder)
   829                         err = KErrAlreadyExists;
   830                         err = KErrAlreadyExists;
   830                         }
   831                         }
   831                     else
   832                     else
   832                         {
   833                         {
   833                         // New item addition.
   834                         // New item addition.
   834                         err = iDb.Add( aItem, aRenameMode == EAutoRename );                        
   835                         if ( aUid == KFavouritesNullUid)
       
   836                             err = iDb.Add( aItem, aRenameMode == EAutoRename );
       
   837                         else  // Existing item update.
       
   838                             err = iDb.Update( aItem, aUid, aRenameMode == EAutoRename );                            
   835                         }
   839                         }
   836                     break;
       
   837                     }
       
   838 
       
   839                 default:
       
   840                     {
       
   841                     // Existing item update.
       
   842                     err = iDb.Update( aItem, aUid, aRenameMode == EAutoRename );
       
   843                     break;
   840                     break;
   844                     }
   841                     }
   845                 }
   842                 }
   846             CommitL();
   843             CommitL();
   847             
   844