Changeset 1835


Ignore:
Timestamp:
02/12/10 09:38:46 (5 years ago)
Author:
lowjoel
Message:

Go back to the v6.0 behaviour that the progress is calculated based on the total amount of data to be erased, not number of files.

Location:
trunk/eraser6/Eraser.Manager
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Manager/DirectExecutor.cs

    r1829 r1835  
    598598            //Get the erasure method if the user specified he wants the default. 
    599599            ErasureMethod method = target.Method; 
     600            dataTotal = method.CalculateEraseDataSize(paths, dataTotal); 
    600601 
    601602            //Set the event's current target status. 
     
    607608            for (int i = 0; i < paths.Count; ++i) 
    608609            { 
     610                //Check that the file exists - we do not want to bother erasing nonexistant files 
     611                StreamInfo info = new StreamInfo(paths[i]); 
     612                if (!info.Exists) 
     613                { 
     614                    Logger.Log(S._("The file {0} was not erased as the file does not exist.", 
     615                        paths[i]), LogLevel.Notice); 
     616                    continue; 
     617                } 
     618 
     619                //Get the filesystem provider to handle the secure file erasures 
     620                FileSystem fsManager = ManagerLibrary.Instance.FileSystemRegistrar[ 
     621                    VolumeInfo.FromMountPoint(info.DirectoryName)]; 
     622 
    609623                //Update the task progress 
    610624                ProgressManager step = new ProgressManager(); 
    611625                progress.Steps.Add(new SteppedProgressManagerStep(step, 
    612                     1.0f / paths.Count, S._("Erasing files..."))); 
     626                    info.Length / (float)dataTotal, S._("Erasing files..."))); 
    613627                task.OnProgressChanged(target, 
    614628                    new ProgressChangedEventArgs(step, 
    615629                        new TaskProgressChangedEventArgs(paths[i], 0, method.Passes))); 
    616  
    617                 //Check that the file exists - we do not want to bother erasing nonexistant files 
    618                 StreamInfo info = new StreamInfo(paths[i]); 
    619                 if (!info.Exists) 
    620                 { 
    621                     Logger.Log(S._("The file {0} was not erased as the file does not exist.", 
    622                         paths[i]), LogLevel.Notice); 
    623                     continue; 
    624                 } 
    625  
    626                 //Get the filesystem provider to handle the secure file erasures 
    627                 FileSystem fsManager = ManagerLibrary.Instance.FileSystemRegistrar[ 
    628                     VolumeInfo.FromMountPoint(info.DirectoryName)]; 
    629630 
    630631                bool isReadOnly = false; 
  • trunk/eraser6/Eraser.Manager/Strings.en.resx

    r1815 r1835  
    151151    <value>Erasing unused directory structures...</value> 
    152152  </data> 
     153  <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
     154    <value>The file {0} was not erased as the file does not exist.</value> 
     155  </data> 
    153156  <data name="Erasing files..." xml:space="preserve"> 
    154157    <value>Erasing files...</value> 
    155158  </data> 
    156   <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
    157     <value>The file {0} was not erased as the file does not exist.</value> 
    158   </data> 
    159159  <data name="The file {0} could not be erased because the file was either compressed, encrypted or a sparse file." xml:space="preserve"> 
    160160    <value>The file {0} could not be erased because the file was either compressed, encrypted or a sparse file.</value> 
  • trunk/eraser6/Eraser.Manager/Strings.it.resx

    r1815 r1835  
    151151    <value>Pulizia delle strutture di cartelle non usate...</value> 
    152152  </data> 
     153  <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
     154    <value>Il file {0} non è stato pulito perchè il file non esiste.</value> 
     155  </data> 
    153156  <data name="Erasing files..." xml:space="preserve"> 
    154157    <value>Pulizia dei files...</value> 
    155158  </data> 
    156   <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
    157     <value>Il file {0} non è stato pulito perchè il file non esiste.</value> 
    158   </data> 
    159159  <data name="The file {0} could not be erased because the file was either compressed, encrypted or a sparse file." xml:space="preserve"> 
    160160    <value>Il file {0} non può essere pulito perchè è compresso, crittato o distribuito.</value> 
  • trunk/eraser6/Eraser.Manager/Strings.nl.resx

    r1815 r1835  
    151151    <value>(Untranslated)</value> 
    152152  </data> 
     153  <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
     154    <value>(Untranslated)</value> 
     155  </data> 
    153156  <data name="Erasing files..." xml:space="preserve"> 
    154157    <value>(Untranslated)</value> 
    155158  </data> 
    156   <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
    157     <value>(Untranslated)</value> 
    158   </data> 
    159159  <data name="The file {0} could not be erased because the file was either compressed, encrypted or a sparse file." xml:space="preserve"> 
    160160    <value>(Untranslated)</value> 
  • trunk/eraser6/Eraser.Manager/Strings.resx

    r1815 r1835  
    151151    <value>Erasing unused directory structures...</value> 
    152152  </data> 
     153  <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
     154    <value>The file {0} was not erased as the file does not exist.</value> 
     155  </data> 
    153156  <data name="Erasing files..." xml:space="preserve"> 
    154157    <value>Erasing files...</value> 
    155158  </data> 
    156   <data name="The file {0} was not erased as the file does not exist." xml:space="preserve"> 
    157     <value>The file {0} was not erased as the file does not exist.</value> 
    158   </data> 
    159159  <data name="The file {0} could not be erased because the file was either compressed, encrypted or a sparse file." xml:space="preserve"> 
    160160    <value>The file {0} could not be erased because the file was either compressed, encrypted or a sparse file.</value> 
Note: See TracChangeset for help on using the changeset viewer.