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

bool Photo::setImage ( QString  editedImageFilename  ) 

Reset photo data after photo editing has taken place. Slideshow and thumbnail images need to be regenerated.

Definition at line 155 of file photo.cpp.

References constructSmallerImages(), Subalbum::getAlbum(), getEverSaved(), Album::getTmpDir(), imageLocation, recentlyReverted, and subalbum.

  //if the image has been saved then simply change the image,slideshow/thubnail 
  //filename handles to point to the temporary directory. We don't need to worry about backing up the
  //image because the new version will be written to the temporary directory and the save location
  if( getEverSaved() )
    imageLocation = subalbum->getAlbum()->getTmpDir() + 
    slideshowLocation = subalbum->getAlbum()->getTmpDir() + 
    thumbnailLocation = subalbum->getAlbum()->getTmpDir() + 
  //otherwise image has never been saved, make sure original form has been backed up!
    QString tempOrigLocation = imageLocation;
    tempOrigLocation.truncate( imageLocation.length() - 4 );
    tempOrigLocation = tempOrigLocation + "_orig.jpg";
    QDir tmpDir;
    if(!tmpDir.exists( tempOrigLocation ) )
    { copyFile( imageLocation, tempOrigLocation ); }    
  //copy over full size image
  copyFile( editedImageFilename, imageLocation );
  //reset revert flag since image has not been modified
  recentlyReverted = false;
  //construct smaller iamges
  return constructSmallerImages();

Generated by  Doxygen 1.6.0   Back to index