Logo Search packages:      
Sourcecode: albumshaper version File versions  Download package

void Album::removeStagnantOrigFiles ( StatusWidget *  status  )  [private]

Removes any _orig images for photos which have been recently reverted to their original form (and hence we can reduce disk usage but removing these effective duplicates)

Definition at line 1093 of file album.cpp.

References firstSubalbum, Subalbum::getFirst(), Photo::getImageFilename(), Subalbum::getNext(), Photo::getNext(), Photo::getRecentlyReverted(), Photo::originalImageFilename(), Photo::setRecentlyReverted(), and tmpDir.

Referenced by exportToDisk().

{
  QDir tmpDir;
  
  //iterate over all collections
  Subalbum* currentSubalbum = firstSubalbum;
  while(currentSubalbum != NULL)
  {
    //iterate over all photos in this subalbum
    Photo* currentPhoto = currentSubalbum->getFirst();
    while(currentPhoto != NULL)
    {
      //if photo recently reverted and orig file is not the current filename remove orig file
      //the orig and current name will match up if a previously saved (but not modified) photo 
      //is modified, reverted, then saved out again
      if(currentPhoto->getRecentlyReverted() &&
         currentPhoto->getImageFilename().compare( currentPhoto->originalImageFilename() ) != 0 )
      {
        tmpDir.remove( currentPhoto->originalImageFilename() );
        currentPhoto->setRecentlyReverted( false );
      }
      
      //move on to next photo
      currentPhoto = currentPhoto->getNext();
      status->incrementProgress();
      qApp->processEvents();
    }
    
    //move on to next subalbum
    currentSubalbum  = currentSubalbum->getNext();
  }      
}


Generated by  Doxygen 1.6.0   Back to index