harvesterplugins/file/src/cfolderrenamedharvester.cpp
changeset 26 367228f82b66
parent 2 208a4ba3894c
child 27 7a8855317cbd
equal deleted inserted replaced
24:1abfa342db42 26:367228f82b66
   290                 TPtrC leaf( fileNamePtr.Right( fileNamePtr.Length() - iNewFolderName.Length() ) );
   290                 TPtrC leaf( fileNamePtr.Right( fileNamePtr.Length() - iNewFolderName.Length() ) );
   291                 TFileName oldFileName( iOldFolderName );
   291                 TFileName oldFileName( iOldFolderName );
   292                 oldFileName.Append( leaf );
   292                 oldFileName.Append( leaf );
   293                 if(entry.IsDir())
   293                 if(entry.IsDir())
   294                     {
   294                     {
   295                     iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction );
   295                     if(iFilePlugin.GetHarvesterState())
   296                     iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction );                
   296                         {
       
   297                         iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction );
       
   298                         iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction );
       
   299                         }
       
   300                     else
       
   301                         {
       
   302                         iFilePlugin.AddToQueueL( oldFileName, ECPixRemoveAction, ETrue );
       
   303                         iFilePlugin.AddToQueueL( fileParser.FullName(), ECPixAddAction, ETrue );
       
   304                         }                    
   297                     }  
   305                     }  
   298                 else
   306                 else
   299                     {
   307                     {
   300                     iFilePlugin.CreateContentIndexItemL( oldFileName, ECPixRemoveAction );
   308                     if( iFilePlugin.GetHarvesterState() )
   301                     iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction, false );
   309                         {
       
   310                         iFilePlugin.CreateContentIndexItemL( oldFileName, ECPixRemoveAction );
       
   311                         iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction, EFalse );
   302                 
   312                 
   303                     iFilePlugin.CreateContentIndexItemL( fileParser.FullName(), ECPixAddAction );
   313                         iFilePlugin.CreateContentIndexItemL( fileParser.FullName(), ECPixAddAction );
   304                     iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction, false );
   314                         iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction, EFalse );
       
   315                         }
       
   316                     else
       
   317                         {
       
   318                         iFilePlugin.AddToQueueL( oldFileName, ECPixRemoveAction, EFalse );
       
   319                         iFilePlugin.AddToQueueL( fileParser.FullName(), ECPixAddAction, EFalse );
       
   320                         }
   305                     }                
   321                     }                
   306                 // TODO: If this is not TRAPPED, state machine breaks 
   322                 // TODO: If this is not TRAPPED, state machine breaks 
   307                 iStepNumber++;
   323                 iStepNumber++;
   308                 }            
   324                 }            
   309             iCurrentIndex++;
   325             iCurrentIndex++;
   420         }
   436         }
   421     }
   437     }
   422 
   438 
   423 void CFolderRenamedHarvester::HandleFolderRenameL()
   439 void CFolderRenamedHarvester::HandleFolderRenameL()
   424     {
   440     {
       
   441     OstTraceFunctionEntry0( CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_ENTRY );
   425     RemoveBackslash(iOldFolderName);
   442     RemoveBackslash(iOldFolderName);
   426     iFilePlugin.CreateFolderFileIndexItemL( iOldFolderName, ECPixRemoveAction );
       
   427     RemoveBackslash(iNewFolderName);
   443     RemoveBackslash(iNewFolderName);
   428     iFilePlugin.CreateFolderFileIndexItemL( iNewFolderName, ECPixAddAction );
   444     if(iFilePlugin.GetHarvesterState())
       
   445         {
       
   446         iFilePlugin.CreateFolderFileIndexItemL( iOldFolderName, ECPixRemoveAction );    
       
   447         iFilePlugin.CreateFolderFileIndexItemL( iNewFolderName, ECPixAddAction );
       
   448         }
       
   449     else
       
   450        iFilePlugin.AddToQueueL(iOldFolderName, ECPixRemoveAction, ETrue);
       
   451        iFilePlugin.AddToQueueL(iNewFolderName, ECPixAddAction, ETrue);
       
   452     OstTraceFunctionExit0( CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_EXIT );
   429     }
   453     }
   430 // End of File
   454 // End of File