|
AlbumShaper
1.0a3
|
A subalbum contains photos. More...
#include <subalbum.h>

Public Member Functions | |
| Subalbum (Album *albm, int number) | |
| Sets default information is the Subalbum number. | |
| ~Subalbum () | |
| Frees photos. | |
| void | setName (QString val) |
| Sets the Subalbum Name. | |
| QString | getName () |
| Gets the Subalbum Name. | |
| void | setDescription (QString val) |
| Sets the Subalbum description. | |
| QString | getDescription () |
| Gets the Subalbum description. | |
| QPixmap * | getRepresentativeImage (int size) |
| gets a sized representative image | |
| void | setRepresentativeImage (QString imageFilename) |
| sets a sized representative image | |
| bool | addPhoto (QString fileName, bool replaceDescription=false, Photo *newPhoto=NULL) |
| Adds a new photo to the Subalbum and appends it to the end, returns TRUE if successful. | |
| bool | lazyAddPhoto (QString imageName, QString slideshowName, QString thumbnailName, Photo *newPhoto) |
| Lazily adds a new photo to the subalbum without rescaling from scrath, returns TRUE if successful. | |
| void | addPhoto (Photo *newPhoto) |
| Adds a preexisting photo object to the Subalbum, appending it to the end. | |
| void | photoMoved (Photo *val) |
| Removes a specified photo without deleting the object. | |
| void | removePhoto (Photo *val) |
| Removes a specified photo. | |
| Subalbum * | getPrev () |
| Returns pointer to prev subalbum. | |
| Subalbum * | getNext () |
| Returns pointer to next subalbum. | |
| void | setPrev (Subalbum *val) |
| Sets pointer of prev subalbum. | |
| void | setNext (Subalbum *val) |
| Sets pointer of next subalbum. | |
| Photo * | getFirst () |
| Returns first photo in subalbum. | |
| Photo * | getLast () |
| Returns last photo in subalbum. | |
| void | exportToXML (StatusWidget *status, QTextStream &stream) |
| Exports subalbum to xml. | |
| void | importFromDisk (QDomNode *root, int subalbumNum, StatusWidget *status, QString dirName, bool disableCheckPhotoMods) |
| Builds subalbum from XML DOM node. | |
| void | syncPhotoList (PhotoPreviewWidget *item) |
| Syncs photo ordering with front end gui ordering. | |
| int | getSubalbumNumber () |
| Returns subalbum number. | |
| void | setSubalbumNumber (int newVal) |
| Sets the subalbum number to newVal. | |
| int | getNumPhotos () |
| Returns the number of photos in the subalbum. | |
| int | getNumLoadedPhotos () |
| Returns the number of loaded photos in subalbum. | |
| void | resetNumLoadedPhotos () |
| void | setModified () |
| Album * | getAlbum () |
| returns the album pointer | |
Private Attributes | |
| int | number |
| Subalbum Number. | |
| int | numPhotos |
| Number of photos in subalbum. | |
| int | loadedPhotos |
| Number of photos in subalbum when last loaded. | |
| QString | name |
| Short Name for subalbum. | |
| QString | description |
| Longer description of subalbum. | |
| QPixmap * | smallRepresentativeImage |
| QPixmap * | mediumRepresentativeImage |
| QPixmap * | largeRepresentativeImage |
| Photo * | firstPhoto |
| Pointer to first photo. | |
| Photo * | lastPhoto |
| Pointer to last photo. | |
| Subalbum * | prevSubalbum |
| Pointer to prev subalbum. | |
| Subalbum * | nextSubalbum |
| Pointer to next subalbum. | |
| Album * | albm |
| Pointer to album subalbum is in. | |
A subalbum contains photos.
Specific contents:
Definition at line 45 of file subalbum.h.
| Subalbum::Subalbum | ( | Album * | albm, |
| int | number | ||
| ) |
Sets default information is the Subalbum number.
Definition at line 35 of file subalbum.cpp.
References albm, SubalbumPreviewWidget::createSubalbumPixmap(), description, firstPhoto, IMAGE_PATH, largeRepresentativeImage, lastPhoto, loadedPhotos, mediumRepresentativeImage, name, nextSubalbum, number, numPhotos, prevSubalbum, and smallRepresentativeImage.
{
//set subalbum number
this->number = number;
//by default no photos in subalbum
numPhotos = 0;
loadedPhotos = 0;
//set strings to default values
name = qApp->translate("Subalbum", "Collection %1").arg(number);
description ="";
//set default rep images
smallRepresentativeImage = NULL;
mediumRepresentativeImage = SubalbumPreviewWidget::createSubalbumPixmap
( QString(IMAGE_PATH)+"miscImages/subalbum.png" );
largeRepresentativeImage = NULL;
//no photos by default
firstPhoto = NULL;
lastPhoto = NULL;
//next and prev pointers null by default
prevSubalbum = NULL;
nextSubalbum = NULL;
//set album pointer
this->albm = albm;
}
| Subalbum::~Subalbum | ( | ) |
Frees photos.
Definition at line 66 of file subalbum.cpp.
References firstPhoto, Photo::getNext(), largeRepresentativeImage, mediumRepresentativeImage, and smallRepresentativeImage.
{
//delete representative images
delete smallRepresentativeImage;
delete mediumRepresentativeImage;
delete largeRepresentativeImage;
//delete all photos
Photo* current = firstPhoto;
while(current != NULL)
{
Photo* temp = current->getNext();
delete current;
current = temp;
}
}
| bool Subalbum::addPhoto | ( | QString | fileName, |
| bool | replaceDescription = false, |
||
| Photo * | newPhoto = NULL |
||
| ) |
Adds a new photo to the Subalbum and appends it to the end, returns TRUE if successful.
Definition at line 197 of file subalbum.cpp.
References albm, firstPhoto, getLast(), Album::getNextUniquePhotoID(), lastPhoto, numPhotos, Photo::setDescription(), Photo::setImage(), Album::setModified(), Photo::setNext(), and Photo::setPrev().
Referenced by SubalbumWidget::addImageAction(), SubalbumPreviewWidget::dropped(), and importFromDisk().
{
//create new photo if necessary
if(newPhoto == NULL)
newPhoto = new Photo(this, getLast(), numPhotos);
//replace description with filename if instructed
//(aka /home/bob/happy.jpg -> happy)
if(replaceDescription)
{
//get filename
QString desc(fileName);
//remove path
desc = desc.section( QRegExp("/"), -1);
//remove extension if it exists
int extensionIndex = desc.findRev( '.' );
if(extensionIndex > 0 )
desc.truncate(extensionIndex);
//convert _'s to spaces
desc = desc.replace('_', ' ');
//set photos description
newPhoto->setDescription( desc );
}
//attempt to set image
if(!newPhoto->setImage(fileName, albm->getNextUniquePhotoID() ))
{
delete newPhoto;
return false;
}
//if this is the first photo set as the head
if(firstPhoto == NULL)
{
firstPhoto = newPhoto;
lastPhoto = newPhoto;
}
//else append to end of list
else
{
lastPhoto->setNext(newPhoto);
newPhoto->setPrev( lastPhoto );
lastPhoto = newPhoto;
}
numPhotos++;
albm->setModified();
return true;
}
| void Subalbum::addPhoto | ( | Photo * | newPhoto | ) |
Adds a preexisting photo object to the Subalbum, appending it to the end.
Definition at line 173 of file subalbum.cpp.
References albm, firstPhoto, lastPhoto, numPhotos, Album::setModified(), Photo::setNext(), and Photo::setPrev().
{
//set the photos next and prev points to NULL by default
newPhoto->setNext(NULL);
newPhoto->setPrev(NULL);
//if list empty set to head
if(firstPhoto == NULL)
{
firstPhoto = newPhoto;
lastPhoto = newPhoto;
}
//else append to end of list
else
{
lastPhoto->setNext(newPhoto);
newPhoto->setPrev( lastPhoto );
lastPhoto = newPhoto;
}
numPhotos++;
albm->setModified();
}
| void Subalbum::exportToXML | ( | StatusWidget * | status, |
| QTextStream & | stream | ||
| ) |
Exports subalbum to xml.
Definition at line 312 of file subalbum.cpp.
References description, Photo::exportToXML(), firstPhoto, fixXMLString(), Photo::getNext(), getRepresentativeImage(), LARGE, name, and number.
Referenced by Album::exportToXML().
{
//write subalbum information
stream << " <subalbum>\n";
//if subalbum has a represenatative image save it's path
if(getRepresentativeImage(LARGE) != NULL )
{
stream << " <thumb path=\"img/" << number << "_thumb.jpg\"/>\n";
stream << " <name>" << fixXMLString(name) << "</name>\n";
}
//else if the name is empty or just whitespace override it with "Subalbum #" so
//it is not invisible on the coverpage
else
{
QString strippedName = fixXMLString(name);
if(strippedName.stripWhiteSpace() == "")
stream << QString(" <name>%1 %2</name>\n").arg(qApp->translate("Subalbum", "Collection")).arg(number);
else
stream << " <name>" << fixXMLString(name) << "</name>\n";
}
stream << " <description>" << fixXMLString(description) << "</description>\n";
//write photos
Photo* current = firstPhoto;
while(current != NULL)
{
current->exportToXML(stream);
current = current->getNext();
}
//close subalbum
stream << " </subalbum>\n";
}
| Album * Subalbum::getAlbum | ( | ) |
returns the album pointer
Definition at line 94 of file subalbum.cpp.
References albm.
Referenced by Photo::applyTransformation(), Photo::originalImageFilename(), and Photo::setImage().
{ return albm; }
| QString Subalbum::getDescription | ( | ) |
Gets the Subalbum description.
Definition at line 84 of file subalbum.cpp.
References description.
Referenced by TitleWidget::refreshCollectionAnnotations().
{ return QString(description); }
| Photo * Subalbum::getFirst | ( | ) |
Returns first photo in subalbum.
Definition at line 99 of file subalbum.cpp.
References firstPhoto.
Referenced by SlideshowWidget::advanceCollection(), AlbumStatistics::AlbumStatistics(), SlideshowWidget::beginSlideshow(), Album::exportCompressedWebAlbum(), Album::exportLargeImages(), Album::exportSubalbumImages(), Album::getThumbnailFilenames(), SubalbumWidget::refreshPhotos(), Album::removeStagnantOrigFiles(), Album::reorderSubalbumImages(), SlideshowWidget::showCollectionPage(), EditingInterface::showFirstPhoto(), and SlideshowWidget::skipToFirstPhoto().
{ return firstPhoto; }
| Photo * Subalbum::getLast | ( | ) |
Returns last photo in subalbum.
Definition at line 100 of file subalbum.cpp.
References lastPhoto.
Referenced by SubalbumWidget::addImageAction(), addPhoto(), SlideshowWidget::backupCollection(), importFromDisk(), EditingInterface::showLastPhoto(), and SlideshowWidget::skipToLastPhoto().
{ return lastPhoto; }
| QString Subalbum::getName | ( | ) |
Gets the Subalbum Name.
Definition at line 83 of file subalbum.cpp.
References name.
Referenced by TitleWidget::refreshCollectionAnnotations(), and TitleWidget::storeAnnotations().
{ return QString(name); }
| Subalbum * Subalbum::getNext | ( | ) |
Returns pointer to next subalbum.
Definition at line 97 of file subalbum.cpp.
References nextSubalbum.
Referenced by SlideshowWidget::advanceCollection(), AlbumStatistics::AlbumStatistics(), SlideshowWidget::beginSlideshow(), Album::exportCompressedWebAlbum(), Album::exportLargeImages(), Album::exportSubalbumImages(), Album::exportToDisk(), Album::exportTopLevelImages(), Album::exportToXML(), Album::getNumPhotos(), Album::getThumbnailFilenames(), SubalbumsWidget::refreshCollectionsList(), Album::removeStagnantImages(), Album::removeStagnantOrigFiles(), Album::removeSubalbum(), Album::reorderSubalbumImages(), Album::syncSubalbumList(), and Album::~Album().
{ return nextSubalbum; }
| int Subalbum::getNumLoadedPhotos | ( | ) |
Returns the number of loaded photos in subalbum.
Definition at line 104 of file subalbum.cpp.
References loadedPhotos.
{ return loadedPhotos; }
| int Subalbum::getNumPhotos | ( | ) |
Returns the number of photos in the subalbum.
Definition at line 103 of file subalbum.cpp.
References numPhotos.
Referenced by SlideshowWidget::backupCollection(), Album::exportLargeImages(), Album::exportToDisk(), Album::getNumPhotos(), SlideshowWidget::paintOverlaidControls(), Album::removeStagnantImages(), and SlideshowWidget::skipToLastPhoto().
{ return numPhotos; }
| Subalbum * Subalbum::getPrev | ( | ) |
Returns pointer to prev subalbum.
Definition at line 96 of file subalbum.cpp.
References prevSubalbum.
Referenced by SlideshowWidget::backupCollection(), and Album::removeSubalbum().
{ return prevSubalbum; }
| QPixmap * Subalbum::getRepresentativeImage | ( | int | size | ) |
gets a sized representative image
Definition at line 86 of file subalbum.cpp.
References LARGE, largeRepresentativeImage, MEDIUM, mediumRepresentativeImage, SMALL, and smallRepresentativeImage.
Referenced by Album::exportCompressedWebAlbum(), Album::exportTopLevelImages(), exportToXML(), TitleWidget::refreshCollectionAnnotations(), TitleWidget::setSubalbumImage(), and TitleWidget::unsetSubalbumImage().
{
if(size == SMALL) return smallRepresentativeImage;
if(size == MEDIUM) return mediumRepresentativeImage;
if(size == LARGE) return largeRepresentativeImage;
else return NULL;
}
| int Subalbum::getSubalbumNumber | ( | ) |
Returns subalbum number.
Definition at line 102 of file subalbum.cpp.
References number.
Referenced by Photo::Photo().
{ return number; }
| void Subalbum::importFromDisk | ( | QDomNode * | root, |
| int | subalbumNum, | ||
| StatusWidget * | status, | ||
| QString | dirName, | ||
| bool | disableCheckPhotoMods | ||
| ) |
Builds subalbum from XML DOM node.
Definition at line 349 of file subalbum.cpp.
References addPhoto(), description, Photo::getImageChecksum(), getLast(), getMD5(), Photo::getSlideshowChecksum(), Photo::getThumbnailChecksum(), Photo::importFromDisk(), StatusWidget::incrementProgress(), lazyAddPhoto(), name, resetNumLoadedPhotos(), and setRepresentativeImage().
Referenced by Album::importFromDisk().
{
//if representative image exists load
QString repName = QString(dirName + "/img/%1_thumb.jpg").arg(subalbumNum);
QImage repImage(repName);
if(!repImage.isNull())
{
setRepresentativeImage(repName);
}
QDomNode node = root->firstChild();
QDomText val;
int photoNum = 0;
while( !node.isNull() )
{
//------------------------------------------------------------
//subalbum name
if( node.isElement() && node.nodeName() == "name" )
{
val = node.firstChild().toText();
if(!val.isNull())
name = val.nodeValue();
name.replace("\\"","\"");
}
//------------------------------------------------------------
//subalbum description
else if( node.isElement() && node.nodeName() == "description" )
{
val = node.firstChild().toText();
if(!val.isNull())
description = val.nodeValue();
description.replace("\\"","\"");
}
//------------------------------------------------------------
//photo
else if( node.isElement() && node.nodeName() == "photo" )
{
//increase counter
photoNum++;
//create new photo object
QString imageName = QString(dirName + "img/%1/%2.jpg").arg(subalbumNum).arg(photoNum);
QString slideshowName = QString(dirName + "img/%1/%2_slideshow.jpg").arg(subalbumNum).arg(photoNum);
QString thumbName = QString(dirName + "img/%1/%2_thumb.jpg").arg(subalbumNum).arg(photoNum);
Photo* newPhoto = new Photo(this, getLast(), photoNum);
//load photo information from disk
QDateTime* modificationTimes = newPhoto->importFromDisk( &node );
//first check to see if modifications times have changed
bool lazyLoad = true; //assume no modifications
//skip checking for mods if disable checking is set
if(!disableCheckPhotoMods)
{
QFileInfo info[3];
info[0].setFile( imageName );
info[1].setFile( slideshowName );
info[2].setFile( thumbName );
if(
modificationTimes[0] != info[0].lastModified() ||
modificationTimes[1] != info[1].lastModified() ||
modificationTimes[2] != info[2].lastModified()
)
lazyLoad = false;
}
//if no changes have occured do lazy load - don't
//bother scaling down thumbnail and slideshow images
//from original image
std::ifstream imageFile ( QFile::encodeName(imageName) );
std::ifstream slideshowFile( QFile::encodeName(slideshowName) );
std::ifstream thumbnailFile( QFile::encodeName(thumbName) );
if( imageFile.is_open() &&
thumbnailFile.is_open() &&
slideshowFile.is_open() &&
(
lazyLoad ||
(
getMD5(imageFile) == newPhoto->getImageChecksum() &&
getMD5(slideshowFile) == newPhoto->getSlideshowChecksum() &&
getMD5(thumbnailFile) == newPhoto->getThumbnailChecksum()
)
)
)
{
//close ifstreams
imageFile.close();
slideshowFile.close();
thumbnailFile.close();
//populate image
lazyAddPhoto(imageName, slideshowName, thumbName, newPhoto);
}
//else reload image and scale it since changes have occured.
else
{
//close ifstreams if open
if(imageFile.is_open())
imageFile.close();
if(thumbnailFile.is_open())
thumbnailFile.close();
//populate image
addPhoto(imageName, false, newPhoto);
}
if(imageFile.is_open())
imageFile.close();
if(slideshowFile.is_open())
slideshowFile.close();
if(thumbnailFile.is_open())
thumbnailFile.close();
//update progress bar
status->incrementProgress();
qApp->processEvents();
}
//------------------------------------------------------------
//advance to next node
node = node.nextSibling();
//------------------------------------------------------------
}
//------------------------------------------------------------
//set loaded number
resetNumLoadedPhotos();
//------------------------------------------------------------
}
| bool Subalbum::lazyAddPhoto | ( | QString | imageName, |
| QString | slideshowName, | ||
| QString | thumbnailName, | ||
| Photo * | newPhoto | ||
| ) |
Lazily adds a new photo to the subalbum without rescaling from scrath, returns TRUE if successful.
Definition at line 251 of file subalbum.cpp.
References albm, firstPhoto, lastPhoto, numPhotos, Photo::setImage(), Album::setModified(), Photo::setNext(), and Photo::setPrev().
Referenced by importFromDisk().
{
//attempt to set image
if(!newPhoto->setImage(imageName, slideshowName, thumbnailName))
{
delete newPhoto;
return false;
}
//if this is the first photo set as the head
if(firstPhoto == NULL)
{
firstPhoto = newPhoto;
lastPhoto = newPhoto;
}
//else append to end of list
else
{
lastPhoto->setNext(newPhoto);
newPhoto->setPrev( lastPhoto );
lastPhoto = newPhoto;
}
numPhotos++;
albm->setModified();
return true;
}
| void Subalbum::photoMoved | ( | Photo * | val | ) |
Removes a specified photo without deleting the object.
Definition at line 483 of file subalbum.cpp.
References albm, firstPhoto, Photo::getNext(), Photo::getPrev(), lastPhoto, numPhotos, Album::setModified(), Photo::setNext(), and Photo::setPrev().
Referenced by SubalbumPreviewWidget::dropped().
{
//if null pointer bail
if(val == NULL) return;
//update first and last pointers if necessary
if(val == firstPhoto) firstPhoto = val->getNext();
if(val == lastPhoto) lastPhoto = val->getPrev();
//splice out
if(val->getPrev() != NULL) val->getPrev()->setNext( val->getNext() );
if(val->getNext() != NULL) val->getNext()->setPrev( val->getPrev() );
numPhotos--;
albm->setModified();
}
| void Subalbum::removePhoto | ( | Photo * | val | ) |
Removes a specified photo.
Definition at line 280 of file subalbum.cpp.
References albm, firstPhoto, Photo::getNext(), Photo::getPrev(), lastPhoto, numPhotos, Album::setModified(), Photo::setNext(), and Photo::setPrev().
Referenced by SubalbumWidget::removeImageAction().
{
//if photo pointer is null then bail
if(val == NULL) return;
//reset head and tail pointers if necessary
if( val == firstPhoto ) firstPhoto = val->getNext();
if( val == lastPhoto ) lastPhoto = val->getPrev();
//splice out
if( val->getPrev() != NULL ) val->getPrev()->setNext( val->getNext() );
if( val->getNext() != NULL ) val->getNext()->setPrev( val->getPrev() );
//delete object
delete val;
val = NULL;
numPhotos--;
albm->setModified();
}
| void Subalbum::resetNumLoadedPhotos | ( | ) |
Definition at line 170 of file subalbum.cpp.
References loadedPhotos, and numPhotos.
Referenced by importFromDisk(), and Album::removeStagnantImages().
{ loadedPhotos = numPhotos; }
| void Subalbum::setDescription | ( | QString | val | ) |
Sets the Subalbum description.
Definition at line 115 of file subalbum.cpp.
References albm, description, and Album::setModified().
Referenced by TitleWidget::storeAnnotations().
{
if(description != val)
{
description = val;
albm->setModified();
}
}
| void Subalbum::setModified | ( | ) |
Definition at line 171 of file subalbum.cpp.
References albm, and Album::setModified().
Referenced by Photo::constructSmallerImages(), Photo::setDescription(), Photo::setNext(), and Photo::setPrev().
{ albm->setModified(); }
| void Subalbum::setName | ( | QString | val | ) |
Sets the Subalbum Name.
Definition at line 106 of file subalbum.cpp.
References albm, name, and Album::setModified().
Referenced by TitleWidget::storeAnnotations().
{
if(name != val)
{
name = val;
albm->setModified();
}
}
| void Subalbum::setNext | ( | Subalbum * | val | ) |
Sets pointer of next subalbum.
Definition at line 306 of file subalbum.cpp.
References albm, nextSubalbum, and Album::setModified().
Referenced by Album::appendSubalbum(), Album::removeSubalbum(), and Album::syncSubalbumList().
{
nextSubalbum = val;
albm->setModified();
}
| void Subalbum::setPrev | ( | Subalbum * | val | ) |
Sets pointer of prev subalbum.
Definition at line 300 of file subalbum.cpp.
References albm, prevSubalbum, and Album::setModified().
Referenced by Album::appendSubalbum(), Album::removeSubalbum(), and Album::syncSubalbumList().
{
prevSubalbum = val;
albm->setModified();
}
| void Subalbum::setRepresentativeImage | ( | QString | imageFilename | ) |
sets a sized representative image
Definition at line 124 of file subalbum.cpp.
References albm, calcScaledImageDimensions(), SubalbumPreviewWidget::createSubalbumPixmap(), getImageSize(), IMAGE_PATH, largeRepresentativeImage, mediumRepresentativeImage, REP_IMAGE_HEIGHT, scaleImage(), Album::setModified(), and smallRepresentativeImage.
Referenced by importFromDisk(), TitleWidget::setSubalbumImage(), and TitleWidget::unsetSubalbumImage().
{
//delete old representative images
delete smallRepresentativeImage;
delete mediumRepresentativeImage;
delete largeRepresentativeImage;
//if being set to null, set back to defaults
if(imageFilename.isNull())
{
smallRepresentativeImage = NULL;
largeRepresentativeImage = NULL;
mediumRepresentativeImage = SubalbumPreviewWidget::createSubalbumPixmap
( QString(IMAGE_PATH)+"miscImages/subalbum.png" );
}
//else create various sized cover images
else
{
int imageWidth, imageHeight;
getImageSize( imageFilename, imageWidth, imageHeight );
//small version (show at top)
int smallRepWidth = 0;
int smallRepHeight = 0;
calcScaledImageDimensions( imageWidth, imageHeight,
107, REP_IMAGE_HEIGHT,
smallRepWidth, smallRepHeight);
QImage thumbnailSmall;
scaleImage( imageFilename, thumbnailSmall, smallRepWidth, smallRepHeight );
smallRepresentativeImage = new QPixmap( thumbnailSmall.width(), thumbnailSmall.height() );
smallRepresentativeImage->convertFromImage( thumbnailSmall );
//medium version (seen in collections listing)
mediumRepresentativeImage = SubalbumPreviewWidget::createSubalbumPixmap( imageFilename );
//large version, used for actually saving out
largeRepresentativeImage = new QPixmap( imageFilename );
//---------------------------------------------------------
}
//set modified
albm->setModified();
}
| void Subalbum::setSubalbumNumber | ( | int | newVal | ) |
Sets the subalbum number to newVal.
Definition at line 169 of file subalbum.cpp.
References number.
Referenced by Album::exportToDisk().
{ number = newVal; }
| void Subalbum::syncPhotoList | ( | PhotoPreviewWidget * | item | ) |
Syncs photo ordering with front end gui ordering.
Definition at line 500 of file subalbum.cpp.
References firstPhoto, Photo::getNext(), PhotoPreviewWidget::getPhoto(), lastPhoto, Photo::setNext(), and Photo::setPrev().
Referenced by SubalbumWidget::reorder().
{
//base case, no items
if(item == NULL)
{
firstPhoto = NULL;
lastPhoto = NULL;
return;
}
//set first and last pointers
firstPhoto = item->getPhoto();
firstPhoto->setNext(NULL);
firstPhoto->setPrev(NULL);
lastPhoto = firstPhoto;
//set all next/prev pointers
while(item->nextItem() != NULL)
{
item->getPhoto()->setNext( ((PhotoPreviewWidget*)item->nextItem())->getPhoto() );
item->getPhoto()->getNext()->setPrev( item->getPhoto() );
item = (PhotoPreviewWidget*)item->nextItem();
lastPhoto = item->getPhoto();
lastPhoto->setNext(NULL);
}
}
Album* Subalbum::albm [private] |
Pointer to album subalbum is in.
Definition at line 177 of file subalbum.h.
Referenced by addPhoto(), getAlbum(), lazyAddPhoto(), photoMoved(), removePhoto(), setDescription(), setModified(), setName(), setNext(), setPrev(), setRepresentativeImage(), and Subalbum().
QString Subalbum::description [private] |
Longer description of subalbum.
Definition at line 157 of file subalbum.h.
Referenced by exportToXML(), getDescription(), importFromDisk(), setDescription(), and Subalbum().
Photo* Subalbum::firstPhoto [private] |
Pointer to first photo.
Definition at line 165 of file subalbum.h.
Referenced by addPhoto(), exportToXML(), getFirst(), lazyAddPhoto(), photoMoved(), removePhoto(), Subalbum(), syncPhotoList(), and ~Subalbum().
QPixmap* Subalbum::largeRepresentativeImage [private] |
Definition at line 162 of file subalbum.h.
Referenced by getRepresentativeImage(), setRepresentativeImage(), Subalbum(), and ~Subalbum().
Photo* Subalbum::lastPhoto [private] |
Pointer to last photo.
Definition at line 168 of file subalbum.h.
Referenced by addPhoto(), getLast(), lazyAddPhoto(), photoMoved(), removePhoto(), Subalbum(), and syncPhotoList().
int Subalbum::loadedPhotos [private] |
Number of photos in subalbum when last loaded.
Definition at line 151 of file subalbum.h.
Referenced by getNumLoadedPhotos(), resetNumLoadedPhotos(), and Subalbum().
QPixmap* Subalbum::mediumRepresentativeImage [private] |
Definition at line 161 of file subalbum.h.
Referenced by getRepresentativeImage(), setRepresentativeImage(), Subalbum(), and ~Subalbum().
QString Subalbum::name [private] |
Short Name for subalbum.
Definition at line 154 of file subalbum.h.
Referenced by exportToXML(), getName(), importFromDisk(), setName(), and Subalbum().
Subalbum* Subalbum::nextSubalbum [private] |
Pointer to next subalbum.
Definition at line 174 of file subalbum.h.
Referenced by getNext(), setNext(), and Subalbum().
int Subalbum::number [private] |
Subalbum Number.
Definition at line 145 of file subalbum.h.
Referenced by exportToXML(), getSubalbumNumber(), setSubalbumNumber(), and Subalbum().
int Subalbum::numPhotos [private] |
Number of photos in subalbum.
Definition at line 148 of file subalbum.h.
Referenced by addPhoto(), getNumPhotos(), lazyAddPhoto(), photoMoved(), removePhoto(), resetNumLoadedPhotos(), and Subalbum().
Subalbum* Subalbum::prevSubalbum [private] |
Pointer to prev subalbum.
Definition at line 171 of file subalbum.h.
Referenced by getPrev(), setPrev(), and Subalbum().
QPixmap* Subalbum::smallRepresentativeImage [private] |
Definition at line 160 of file subalbum.h.
Referenced by getRepresentativeImage(), setRepresentativeImage(), Subalbum(), and ~Subalbum().
1.7.5.1