notepad/notepad1/LibSrc/NpdModel.cpp
branchRCL_3
changeset 20 21239b3bcd78
parent 0 f979ecb2b13e
child 21 9711e452b5e9
--- a/notepad/notepad1/LibSrc/NpdModel.cpp	Wed Mar 31 21:29:10 2010 +0300
+++ b/notepad/notepad1/LibSrc/NpdModel.cpp	Wed Apr 14 15:55:57 2010 +0300
@@ -385,6 +385,7 @@
         {
         User::LeaveIfError(iSavedDeleteKeys.Append(aKeys[i]));
         }
+    iProgressCount = 0;
     ExecuteDeleteStepL();
     iRetval = iFileSession.ReleaseReserveAccess( KDefaultDrive );
     iFileSession.Close();
@@ -397,7 +398,7 @@
 //
 void CNotepadModel::ExecuteDeleteStepL()
     {
-    iProgressCount = 0;
+    
     iStepCount = iSavedDeleteKeys.Count();
     if ( iStepCount > KNotepadMaxDeleteCountInStep )
         {
@@ -411,12 +412,6 @@
     if ( IsTemplates() )
         {
         iSavedDeleteKeys.Remove(0);
-        for (TInt i(0); i < iStepCount - 1; i++)
-            {
-            sql.Append(KNotepadSqlDeleteByKeysAppend);
-            sql.AppendNum(iSavedDeleteKeys[0]);
-            iSavedDeleteKeys.Remove(0);
-            }
         }
     else // If Notepad, Remove is postponed until remove link phase
         {
@@ -512,6 +507,15 @@
             else // do next step
                 {
                 increment = iStepCount - iProgressCount;
+
+                iProgressCount += increment;
+                if ( iModelObserver )
+                    {
+                    iModelObserver->HandleNotepadModelEventL(
+                            MNotepadModelObserver::EProgressDeletion,
+                            1 );
+                    }
+
                 ExecuteDeleteStepL();
                 }
             }
@@ -530,15 +534,7 @@
         {
         increment = iDbUpdate.RowCount() - iProgressCount;
         }            
-    if ( increment > 0 )
-        {
-        iProgressCount += increment;
-        if ( iModelObserver )
-            {
-            iModelObserver->HandleNotepadModelEventL(
-                MNotepadModelObserver::EProgressDeletion, increment);
-            }
-        }
+    
     if ( deleteFinished || ( stat == 0 && 
         SysUtil::FFSSpaceBelowCriticalLevelL(&(iEnv->FsSession())) ) )
         {