Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 4f45e7bdfd4a5ff17f5f8eaab90d017f > files > 1667

albumshaper-2.1-6mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AlbumShaper: subalbum.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>subalbum.cpp</h1><a href="subalbum_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==============================================</span>
<a name="l00002"></a>00002 <span class="comment">//  copyright            : (C) 2003-2005 by Will Stokes</span>
<a name="l00003"></a>00003 <span class="comment">//==============================================</span>
<a name="l00004"></a>00004 <span class="comment">//  This program is free software; you can redistribute it</span>
<a name="l00005"></a>00005 <span class="comment">//  and/or modify it under the terms of the GNU General</span>
<a name="l00006"></a>00006 <span class="comment">//  Public License as published by the Free Software</span>
<a name="l00007"></a>00007 <span class="comment">//  Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">//  (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">//==============================================</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">//Systemwide includes</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;qimage.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;qpixmap.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;qstring.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;qtextstream.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;qdom.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;qdir.h&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;qregexp.h&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;qapplication.h&gt;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="comment">//Projectwide includes</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="album_8h.html">album.h</a>"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="subalbum_8h.html">subalbum.h</a>"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="photo_8h.html">photo.h</a>"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="imageTools_8h.html">tools/imageTools.h</a>"</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="xmlTools_8h.html">tools/xmlTools.h</a>"</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="md5_8h.html">tools/md5.h</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "../config.h"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "../gui/photoPreviewWidget.h"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "../gui/statusWidget.h"</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "../gui/subalbumPreviewWidget.h"</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="comment">//==============================================</span>
<a name="l00035"></a><a class="code" href="classSubalbum.html#f4bc559914c481772894e3090aeee7ab">00035</a> <a class="code" href="classSubalbum.html#f4bc559914c481772894e3090aeee7ab" title="Sets default information  is the Subalbum number.">Subalbum::Subalbum</a>(<a class="code" href="classAlbum.html" title="An album contains Subalbums.">Album</a>* albm, <span class="keywordtype">int</span> number)
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037   <span class="comment">//set subalbum number</span>
<a name="l00038"></a>00038   this-&gt;number = number;
<a name="l00039"></a>00039 
<a name="l00040"></a>00040   <span class="comment">//by default no photos in subalbum</span>
<a name="l00041"></a>00041   <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a> = 0;
<a name="l00042"></a>00042   <a class="code" href="classSubalbum.html#b51f1d02adc4219864f39a02609d3e7c" title="Number of photos in subalbum when last loaded.">loadedPhotos</a> = 0;
<a name="l00043"></a>00043 
<a name="l00044"></a>00044   <span class="comment">//set strings to default values</span>
<a name="l00045"></a>00045   <a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a> = qApp-&gt;translate(<span class="stringliteral">"Subalbum"</span>, <span class="stringliteral">"Collection %1"</span>).arg(number);
<a name="l00046"></a>00046   <a class="code" href="classSubalbum.html#983620a2f934d2437314902a1782038c" title="Longer description of subalbum.">description</a> =<span class="stringliteral">""</span>;
<a name="l00047"></a>00047 
<a name="l00048"></a>00048   <span class="comment">//set default rep images</span>
<a name="l00049"></a>00049   <a class="code" href="classSubalbum.html#f11a032922b53c12c5622b6fdd8545e4">smallRepresentativeImage</a> = NULL;
<a name="l00050"></a>00050   <a class="code" href="classSubalbum.html#ceef18d39657f0bb0e372a6c45005a01">mediumRepresentativeImage</a> = <a class="code" href="classSubalbumPreviewWidget.html#86e6f2aa6a9ab400eb709667c6f5c0c1">SubalbumPreviewWidget::createSubalbumPixmap</a>
<a name="l00051"></a>00051   ( QString(<a class="code" href="config_8cpp.html#59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+<span class="stringliteral">"miscImages/subalbum.png"</span> );
<a name="l00052"></a>00052   <a class="code" href="classSubalbum.html#c288c750721a4dcdb77561ed9464fef0">largeRepresentativeImage</a> = NULL;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054   <span class="comment">//no photos by default</span>
<a name="l00055"></a>00055   <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = NULL;
<a name="l00056"></a>00056   <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = NULL;
<a name="l00057"></a>00057 
<a name="l00058"></a>00058   <span class="comment">//next and prev pointers null by default</span>
<a name="l00059"></a>00059   <a class="code" href="classSubalbum.html#54c5ce9ad52359e1a6f26517328c0ee2" title="Pointer to prev subalbum.">prevSubalbum</a> = NULL;
<a name="l00060"></a>00060   <a class="code" href="classSubalbum.html#6ac8347a1e335fcb4480fc63fdc8f9dc" title="Pointer to next subalbum.">nextSubalbum</a> = NULL;
<a name="l00061"></a>00061 
<a name="l00062"></a>00062   <span class="comment">//set album pointer</span>
<a name="l00063"></a>00063   this-&gt;albm = albm;
<a name="l00064"></a>00064 }
<a name="l00065"></a>00065 <span class="comment">//==============================================</span>
<a name="l00066"></a><a class="code" href="classSubalbum.html#e607191111f464b613c9369f78a57624">00066</a> <a class="code" href="classSubalbum.html#e607191111f464b613c9369f78a57624" title="Frees photos.">Subalbum::~Subalbum</a>()
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068   <span class="comment">//delete representative images</span>
<a name="l00069"></a>00069   <span class="keyword">delete</span> <a class="code" href="classSubalbum.html#f11a032922b53c12c5622b6fdd8545e4">smallRepresentativeImage</a>;
<a name="l00070"></a>00070   <span class="keyword">delete</span> <a class="code" href="classSubalbum.html#ceef18d39657f0bb0e372a6c45005a01">mediumRepresentativeImage</a>;
<a name="l00071"></a>00071   <span class="keyword">delete</span> <a class="code" href="classSubalbum.html#c288c750721a4dcdb77561ed9464fef0">largeRepresentativeImage</a>;
<a name="l00072"></a>00072 
<a name="l00073"></a>00073   <span class="comment">//delete all photos</span>
<a name="l00074"></a>00074   <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* current = <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a>;
<a name="l00075"></a>00075   <span class="keywordflow">while</span>(current != NULL)
<a name="l00076"></a>00076   {
<a name="l00077"></a>00077     <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* temp = current-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>();
<a name="l00078"></a>00078     <span class="keyword">delete</span> current;
<a name="l00079"></a>00079     current = temp;
<a name="l00080"></a>00080   }
<a name="l00081"></a>00081 }
<a name="l00082"></a>00082 <span class="comment">//==============================================</span>
<a name="l00083"></a><a class="code" href="classSubalbum.html#9d735164fdf19535c1dce8ba995c8a48">00083</a> QString <a class="code" href="classSubalbum.html#9d735164fdf19535c1dce8ba995c8a48" title="Gets the Subalbum Name.">Subalbum::getName</a>()        { <span class="keywordflow">return</span> QString(<a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a>);        }
<a name="l00084"></a><a class="code" href="classSubalbum.html#82c1c3df230784af3b52016f05f2d284">00084</a> QString <a class="code" href="classSubalbum.html#82c1c3df230784af3b52016f05f2d284" title="Gets the Subalbum description.">Subalbum::getDescription</a>() { <span class="keywordflow">return</span> QString(<a class="code" href="classSubalbum.html#983620a2f934d2437314902a1782038c" title="Longer description of subalbum.">description</a>); }
<a name="l00085"></a>00085 <span class="comment">//==============================================</span>
<a name="l00086"></a><a class="code" href="classSubalbum.html#9bd87802ff9f634579c35d4a399c1227">00086</a> QPixmap* <a class="code" href="classSubalbum.html#9bd87802ff9f634579c35d4a399c1227" title="gets a sized representative image">Subalbum::getRepresentativeImage</a>(<span class="keywordtype">int</span> size)
<a name="l00087"></a>00087 {
<a name="l00088"></a>00088   <span class="keywordflow">if</span>(size == <a class="code" href="album_8h.html#09c78d2f8feb311dd9fc969a0bf84979">SMALL</a>)  <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#f11a032922b53c12c5622b6fdd8545e4">smallRepresentativeImage</a>;
<a name="l00089"></a>00089   <span class="keywordflow">if</span>(size == <a class="code" href="album_8h.html#455b219d48b21108576f53129be38c32">MEDIUM</a>) <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#ceef18d39657f0bb0e372a6c45005a01">mediumRepresentativeImage</a>;
<a name="l00090"></a>00090   <span class="keywordflow">if</span>(size == <a class="code" href="album_8h.html#c27c2124ca2aed651e06aba3a1468ecb">LARGE</a>)  <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#c288c750721a4dcdb77561ed9464fef0">largeRepresentativeImage</a>;
<a name="l00091"></a>00091   <span class="keywordflow">else</span>               <span class="keywordflow">return</span> NULL;
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 <span class="comment">//==============================================</span>
<a name="l00094"></a><a class="code" href="classSubalbum.html#b42d5716bb7253d290302bd1d735d578">00094</a> <a class="code" href="classAlbum.html" title="An album contains Subalbums.">Album</a>* <a class="code" href="classSubalbum.html#b42d5716bb7253d290302bd1d735d578" title="returns the album pointer">Subalbum::getAlbum</a>()        { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>;         }
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="classSubalbum.html#08c5cb587f5faa8b18a96ee04af8dc56">00096</a> <a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* <a class="code" href="classSubalbum.html#08c5cb587f5faa8b18a96ee04af8dc56" title="Returns pointer to prev subalbum.">Subalbum::getPrev</a>()      { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#54c5ce9ad52359e1a6f26517328c0ee2" title="Pointer to prev subalbum.">prevSubalbum</a>; }
<a name="l00097"></a><a class="code" href="classSubalbum.html#510a01088f04712e93ae202cc758065f">00097</a> <a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* <a class="code" href="classSubalbum.html#510a01088f04712e93ae202cc758065f" title="Returns pointer to next subalbum.">Subalbum::getNext</a>()      { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#6ac8347a1e335fcb4480fc63fdc8f9dc" title="Pointer to next subalbum.">nextSubalbum</a>; }
<a name="l00098"></a>00098 
<a name="l00099"></a><a class="code" href="classSubalbum.html#a38b7736f58738d25426bf0cd93fc28a">00099</a> <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* <a class="code" href="classSubalbum.html#a38b7736f58738d25426bf0cd93fc28a" title="Returns first photo in subalbum.">Subalbum::getFirst</a>()        { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a>;   }
<a name="l00100"></a><a class="code" href="classSubalbum.html#22578a064d4c60f3bba4b0e8d314ce42">00100</a> <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* <a class="code" href="classSubalbum.html#22578a064d4c60f3bba4b0e8d314ce42" title="Returns last photo in subalbum.">Subalbum::getLast</a>()         { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>;    }
<a name="l00101"></a>00101 
<a name="l00102"></a><a class="code" href="classSubalbum.html#421e48eea5937cd4718a34410bdc29cb">00102</a> <span class="keywordtype">int</span> <a class="code" href="classSubalbum.html#421e48eea5937cd4718a34410bdc29cb" title="Returns subalbum number.">Subalbum::getSubalbumNumber</a>()  { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#16e483535b3378a7e931f66d933d3e79" title="Subalbum Number.">number</a>;       }
<a name="l00103"></a><a class="code" href="classSubalbum.html#1a55114adae96d7c2a87e37f6a40fe2d">00103</a> <span class="keywordtype">int</span> <a class="code" href="classSubalbum.html#1a55114adae96d7c2a87e37f6a40fe2d" title="Returns the number of photos in the subalbum.">Subalbum::getNumPhotos</a>()       { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>;    }
<a name="l00104"></a><a class="code" href="classSubalbum.html#dd5b24cedda52cf2c7527603097b1dd4">00104</a> <span class="keywordtype">int</span> <a class="code" href="classSubalbum.html#dd5b24cedda52cf2c7527603097b1dd4" title="Returns the number of loaded photos in subalbum.">Subalbum::getNumLoadedPhotos</a>() { <span class="keywordflow">return</span> <a class="code" href="classSubalbum.html#b51f1d02adc4219864f39a02609d3e7c" title="Number of photos in subalbum when last loaded.">loadedPhotos</a>; }
<a name="l00105"></a>00105 <span class="comment">//==============================================</span>
<a name="l00106"></a><a class="code" href="classSubalbum.html#8735ad9f854b8019e4351c1536576eb1">00106</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#8735ad9f854b8019e4351c1536576eb1" title="Sets the Subalbum Name.">Subalbum::setName</a>(QString val)
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108   <span class="keywordflow">if</span>(<a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a> != val)
<a name="l00109"></a>00109   {
<a name="l00110"></a>00110     <a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a> = val;
<a name="l00111"></a>00111     <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00112"></a>00112   }
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114 <span class="comment">//==============================================</span>
<a name="l00115"></a><a class="code" href="classSubalbum.html#c8e40e8b636ab289956b5a0568cd296b">00115</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#c8e40e8b636ab289956b5a0568cd296b" title="Sets the Subalbum description.">Subalbum::setDescription</a>(QString val)
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117   <span class="keywordflow">if</span>(<a class="code" href="classSubalbum.html#983620a2f934d2437314902a1782038c" title="Longer description of subalbum.">description</a> != val)
<a name="l00118"></a>00118   {
<a name="l00119"></a>00119     <a class="code" href="classSubalbum.html#983620a2f934d2437314902a1782038c" title="Longer description of subalbum.">description</a> = val;
<a name="l00120"></a>00120     <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00121"></a>00121   }
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 <span class="comment">//==============================================</span>
<a name="l00124"></a><a class="code" href="classSubalbum.html#61c23c492eef5def5d3aefa85e785433">00124</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#61c23c492eef5def5d3aefa85e785433" title="sets a sized representative image">Subalbum::setRepresentativeImage</a>(QString imageFilename)
<a name="l00125"></a>00125 {
<a name="l00126"></a>00126   <span class="comment">//delete old representative images</span>
<a name="l00127"></a>00127   <span class="keyword">delete</span> <a class="code" href="classSubalbum.html#f11a032922b53c12c5622b6fdd8545e4">smallRepresentativeImage</a>;
<a name="l00128"></a>00128   <span class="keyword">delete</span> <a class="code" href="classSubalbum.html#ceef18d39657f0bb0e372a6c45005a01">mediumRepresentativeImage</a>;
<a name="l00129"></a>00129   <span class="keyword">delete</span> <a class="code" href="classSubalbum.html#c288c750721a4dcdb77561ed9464fef0">largeRepresentativeImage</a>;
<a name="l00130"></a>00130 
<a name="l00131"></a>00131   <span class="comment">//if being set to null, set back to defaults</span>
<a name="l00132"></a>00132   <span class="keywordflow">if</span>(imageFilename.isNull())
<a name="l00133"></a>00133   {
<a name="l00134"></a>00134     <a class="code" href="classSubalbum.html#f11a032922b53c12c5622b6fdd8545e4">smallRepresentativeImage</a> = NULL;
<a name="l00135"></a>00135     <a class="code" href="classSubalbum.html#c288c750721a4dcdb77561ed9464fef0">largeRepresentativeImage</a> = NULL;
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     <a class="code" href="classSubalbum.html#ceef18d39657f0bb0e372a6c45005a01">mediumRepresentativeImage</a> = <a class="code" href="classSubalbumPreviewWidget.html#86e6f2aa6a9ab400eb709667c6f5c0c1">SubalbumPreviewWidget::createSubalbumPixmap</a>
<a name="l00138"></a>00138                                 ( QString(<a class="code" href="config_8cpp.html#59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+<span class="stringliteral">"miscImages/subalbum.png"</span> );
<a name="l00139"></a>00139   }
<a name="l00140"></a>00140   <span class="comment">//else create various sized cover images</span>
<a name="l00141"></a>00141   <span class="keywordflow">else</span>
<a name="l00142"></a>00142   {
<a name="l00143"></a>00143     <span class="keywordtype">int</span> imageWidth, imageHeight;
<a name="l00144"></a>00144     <a class="code" href="imageTools_8cpp.html#2af7f0a9c4f931ad3213c36796e95288" title="Get image dimensions.">getImageSize</a>( imageFilename, imageWidth, imageHeight );
<a name="l00145"></a>00145     
<a name="l00146"></a>00146     <span class="comment">//small version (show at top)</span>
<a name="l00147"></a>00147     <span class="keywordtype">int</span> smallRepWidth = 0;
<a name="l00148"></a>00148     <span class="keywordtype">int</span> smallRepHeight = 0;
<a name="l00149"></a>00149     <a class="code" href="imageTools_8cpp.html#b6483215237a72d6b725adc644d40f0b" title="Computes scale of image dimensions while respecting aspect ratio, equivalent to a...">calcScaledImageDimensions</a>( imageWidth, imageHeight,
<a name="l00150"></a>00150                                107, <a class="code" href="config_8h.html#c4a5acadee7615ea7878342032d6fb79">REP_IMAGE_HEIGHT</a>,
<a name="l00151"></a>00151                                smallRepWidth, smallRepHeight);
<a name="l00152"></a>00152     QImage thumbnailSmall;
<a name="l00153"></a>00153     <a class="code" href="imageTools_8cpp.html#126e11984fb8124e78e3b1b68a24870c" title="Scale image and save copy to disk.">scaleImage</a>( imageFilename, thumbnailSmall, smallRepWidth, smallRepHeight );
<a name="l00154"></a>00154     <a class="code" href="classSubalbum.html#f11a032922b53c12c5622b6fdd8545e4">smallRepresentativeImage</a> = <span class="keyword">new</span> QPixmap( thumbnailSmall.width(), thumbnailSmall.height() );
<a name="l00155"></a>00155     <a class="code" href="classSubalbum.html#f11a032922b53c12c5622b6fdd8545e4">smallRepresentativeImage</a>-&gt;convertFromImage( thumbnailSmall );
<a name="l00156"></a>00156 
<a name="l00157"></a>00157     <span class="comment">//medium version (seen in collections listing)</span>
<a name="l00158"></a>00158     <a class="code" href="classSubalbum.html#ceef18d39657f0bb0e372a6c45005a01">mediumRepresentativeImage</a> = <a class="code" href="classSubalbumPreviewWidget.html#86e6f2aa6a9ab400eb709667c6f5c0c1">SubalbumPreviewWidget::createSubalbumPixmap</a>( imageFilename );
<a name="l00159"></a>00159     
<a name="l00160"></a>00160     <span class="comment">//large version, used for actually saving out</span>
<a name="l00161"></a>00161     <a class="code" href="classSubalbum.html#c288c750721a4dcdb77561ed9464fef0">largeRepresentativeImage</a> = <span class="keyword">new</span> QPixmap( imageFilename );
<a name="l00162"></a>00162     <span class="comment">//---------------------------------------------------------</span>
<a name="l00163"></a>00163   }
<a name="l00164"></a>00164 
<a name="l00165"></a>00165   <span class="comment">//set modified</span>
<a name="l00166"></a>00166   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168 <span class="comment">//==============================================</span>
<a name="l00169"></a><a class="code" href="classSubalbum.html#4f43f5424c1400ce2ddad3a143db5418">00169</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#4f43f5424c1400ce2ddad3a143db5418" title="Sets the subalbum number to newVal.">Subalbum::setSubalbumNumber</a>(<span class="keywordtype">int</span> newVal) { <a class="code" href="classSubalbum.html#16e483535b3378a7e931f66d933d3e79" title="Subalbum Number.">number</a> = newVal;          }
<a name="l00170"></a><a class="code" href="classSubalbum.html#a93dcf1d9ca349da4cbe39a0c569c37b">00170</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#a93dcf1d9ca349da4cbe39a0c569c37b">Subalbum::resetNumLoadedPhotos</a>()        { <a class="code" href="classSubalbum.html#b51f1d02adc4219864f39a02609d3e7c" title="Number of photos in subalbum when last loaded.">loadedPhotos</a> = <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>; }
<a name="l00171"></a><a class="code" href="classSubalbum.html#a01ad19461ce049774595512960f73cb">00171</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#a01ad19461ce049774595512960f73cb">Subalbum::setModified</a>()                 { <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();      }
<a name="l00172"></a>00172 <span class="comment">//==============================================</span>
<a name="l00173"></a><a class="code" href="classSubalbum.html#599a195ccf33ebe6f7c42db1cefd228d">00173</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#12db5ef063152af51a8ded94d7bee730" title="Adds a new photo to the Subalbum and appends it to the end, returns TRUE if successful...">Subalbum::addPhoto</a>(<a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* newPhoto)
<a name="l00174"></a>00174 {
<a name="l00175"></a>00175   <span class="comment">//set the photos next and prev points to NULL by default</span>
<a name="l00176"></a>00176   newPhoto-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>(NULL);
<a name="l00177"></a>00177   newPhoto-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>(NULL);
<a name="l00178"></a>00178 
<a name="l00179"></a>00179   <span class="comment">//if list empty set to head</span>
<a name="l00180"></a>00180   <span class="keywordflow">if</span>(<a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> == NULL)
<a name="l00181"></a>00181   {
<a name="l00182"></a>00182     <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = newPhoto;
<a name="l00183"></a>00183     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = newPhoto;
<a name="l00184"></a>00184   }
<a name="l00185"></a>00185   <span class="comment">//else append to end of list</span>
<a name="l00186"></a>00186   <span class="keywordflow">else</span>
<a name="l00187"></a>00187   {
<a name="l00188"></a>00188     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>(newPhoto);
<a name="l00189"></a>00189     newPhoto-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>( <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> );
<a name="l00190"></a>00190     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = newPhoto;
<a name="l00191"></a>00191   }
<a name="l00192"></a>00192 
<a name="l00193"></a>00193   <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>++;
<a name="l00194"></a>00194   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196 <span class="comment">//==============================================</span>
<a name="l00197"></a><a class="code" href="classSubalbum.html#12db5ef063152af51a8ded94d7bee730">00197</a> <span class="keywordtype">bool</span> <a class="code" href="classSubalbum.html#12db5ef063152af51a8ded94d7bee730" title="Adds a new photo to the Subalbum and appends it to the end, returns TRUE if successful...">Subalbum::addPhoto</a>(QString fileName, <span class="keywordtype">bool</span> replaceDescription, <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* newPhoto)
<a name="l00198"></a>00198 {
<a name="l00199"></a>00199   <span class="comment">//create new photo if necessary</span>
<a name="l00200"></a>00200   <span class="keywordflow">if</span>(newPhoto == NULL)
<a name="l00201"></a>00201     newPhoto = <span class="keyword">new</span> <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>(<span class="keyword">this</span>, <a class="code" href="classSubalbum.html#22578a064d4c60f3bba4b0e8d314ce42" title="Returns last photo in subalbum.">getLast</a>(), <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>);
<a name="l00202"></a>00202 
<a name="l00203"></a>00203   <span class="comment">//replace description with filename if instructed</span>
<a name="l00204"></a>00204   <span class="comment">//(aka /home/bob/happy.jpg -&gt; happy)</span>
<a name="l00205"></a>00205   <span class="keywordflow">if</span>(replaceDescription)
<a name="l00206"></a>00206   {
<a name="l00207"></a>00207     <span class="comment">//get filename</span>
<a name="l00208"></a>00208     QString desc(fileName);
<a name="l00209"></a>00209 
<a name="l00210"></a>00210     <span class="comment">//remove path</span>
<a name="l00211"></a>00211     desc = desc.section( QRegExp(<span class="stringliteral">"/"</span>), -1);
<a name="l00212"></a>00212 
<a name="l00213"></a>00213     <span class="comment">//remove extension if it exists</span>
<a name="l00214"></a>00214     <span class="keywordtype">int</span> extensionIndex = desc.findRev( <span class="charliteral">'.'</span> );
<a name="l00215"></a>00215     <span class="keywordflow">if</span>(extensionIndex &gt; 0 )
<a name="l00216"></a>00216       desc.truncate(extensionIndex);
<a name="l00217"></a>00217 
<a name="l00218"></a>00218     <span class="comment">//convert _'s to spaces</span>
<a name="l00219"></a>00219     desc = desc.replace(<span class="charliteral">'_'</span>, <span class="charliteral">' '</span>);
<a name="l00220"></a>00220 
<a name="l00221"></a>00221     <span class="comment">//set photos description</span>
<a name="l00222"></a>00222     newPhoto-&gt;<a class="code" href="classPhoto.html#b9460c196309be9f0084bbeb91ac04c6" title="Sets the description.">setDescription</a>( desc );
<a name="l00223"></a>00223   }
<a name="l00224"></a>00224 
<a name="l00225"></a>00225   <span class="comment">//attempt to set image</span>
<a name="l00226"></a>00226   <span class="keywordflow">if</span>(!newPhoto-&gt;<a class="code" href="classPhoto.html#29e2aae62991d904c3cb763ec838d9bd" title="Setup photo using preexisting full size, slideshow, and thumbnail images.">setImage</a>(fileName, <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#48dc741d5a9890c85c008f788767b7ac" title="Returns the next unique photo id.">getNextUniquePhotoID</a>() ))
<a name="l00227"></a>00227   {
<a name="l00228"></a>00228     <span class="keyword">delete</span> newPhoto;
<a name="l00229"></a>00229     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00230"></a>00230   }
<a name="l00231"></a>00231 
<a name="l00232"></a>00232   <span class="comment">//if this is the first photo set as the head</span>
<a name="l00233"></a>00233   <span class="keywordflow">if</span>(<a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> == NULL)
<a name="l00234"></a>00234   {
<a name="l00235"></a>00235     <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = newPhoto;
<a name="l00236"></a>00236     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = newPhoto;
<a name="l00237"></a>00237   }
<a name="l00238"></a>00238   <span class="comment">//else append to end of list</span>
<a name="l00239"></a>00239   <span class="keywordflow">else</span>
<a name="l00240"></a>00240   {
<a name="l00241"></a>00241     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>(newPhoto);
<a name="l00242"></a>00242     newPhoto-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>( <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> );
<a name="l00243"></a>00243     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = newPhoto;
<a name="l00244"></a>00244   }
<a name="l00245"></a>00245 
<a name="l00246"></a>00246   <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>++;
<a name="l00247"></a>00247   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00248"></a>00248   <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00249"></a>00249 }
<a name="l00250"></a>00250 <span class="comment">//==============================================</span>
<a name="l00251"></a><a class="code" href="classSubalbum.html#4380016d07f980852e03ccf18ef65dff">00251</a> <span class="keywordtype">bool</span> <a class="code" href="classSubalbum.html#4380016d07f980852e03ccf18ef65dff" title="Lazily adds a new photo to the subalbum without rescaling from scrath, returns TRUE...">Subalbum::lazyAddPhoto</a>(QString imageName, QString slideshowName, QString thumbnailName, 
<a name="l00252"></a>00252                             <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* newPhoto)
<a name="l00253"></a>00253 {
<a name="l00254"></a>00254   <span class="comment">//attempt to set image</span>
<a name="l00255"></a>00255   <span class="keywordflow">if</span>(!newPhoto-&gt;<a class="code" href="classPhoto.html#29e2aae62991d904c3cb763ec838d9bd" title="Setup photo using preexisting full size, slideshow, and thumbnail images.">setImage</a>(imageName, slideshowName, thumbnailName))
<a name="l00256"></a>00256   {
<a name="l00257"></a>00257     <span class="keyword">delete</span> newPhoto;
<a name="l00258"></a>00258     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00259"></a>00259   }
<a name="l00260"></a>00260 
<a name="l00261"></a>00261   <span class="comment">//if this is the first photo set as the head</span>
<a name="l00262"></a>00262   <span class="keywordflow">if</span>(<a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> == NULL)
<a name="l00263"></a>00263   {
<a name="l00264"></a>00264     <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = newPhoto;
<a name="l00265"></a>00265     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = newPhoto;
<a name="l00266"></a>00266   }
<a name="l00267"></a>00267   <span class="comment">//else append to end of list</span>
<a name="l00268"></a>00268   <span class="keywordflow">else</span>
<a name="l00269"></a>00269   {
<a name="l00270"></a>00270     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>(newPhoto);
<a name="l00271"></a>00271     newPhoto-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>( <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> );
<a name="l00272"></a>00272     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = newPhoto;
<a name="l00273"></a>00273   }
<a name="l00274"></a>00274   
<a name="l00275"></a>00275   <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>++;
<a name="l00276"></a>00276   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00277"></a>00277   <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00278"></a>00278 }
<a name="l00279"></a>00279 <span class="comment">//==============================================</span>
<a name="l00280"></a><a class="code" href="classSubalbum.html#4ca46c83f9d143f34bb898f6c0c0fd90">00280</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#4ca46c83f9d143f34bb898f6c0c0fd90" title="Removes a specified photo.">Subalbum::removePhoto</a>(<a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* val)
<a name="l00281"></a>00281 {
<a name="l00282"></a>00282   <span class="comment">//if photo pointer is null then bail</span>
<a name="l00283"></a>00283   <span class="keywordflow">if</span>(val == NULL) <span class="keywordflow">return</span>;
<a name="l00284"></a>00284   
<a name="l00285"></a>00285   <span class="comment">//reset head and tail pointers if necessary</span>
<a name="l00286"></a>00286   <span class="keywordflow">if</span>( val == <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> )   <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>();
<a name="l00287"></a>00287   <span class="keywordflow">if</span>( val == <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> )    <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>  = val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>();
<a name="l00288"></a>00288   
<a name="l00289"></a>00289   <span class="comment">//splice out</span>
<a name="l00290"></a>00290   <span class="keywordflow">if</span>( val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>() != NULL ) val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>()-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>( val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>() );
<a name="l00291"></a>00291   <span class="keywordflow">if</span>( val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>() != NULL ) val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>()-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>( val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>() );
<a name="l00292"></a>00292 
<a name="l00293"></a>00293   <span class="comment">//delete object</span>
<a name="l00294"></a>00294   <span class="keyword">delete</span> val;
<a name="l00295"></a>00295   val = NULL;
<a name="l00296"></a>00296   <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>--;
<a name="l00297"></a>00297   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00298"></a>00298 }
<a name="l00299"></a>00299 <span class="comment">//==============================================</span>
<a name="l00300"></a><a class="code" href="classSubalbum.html#976c57e474987e1c54a6921c1f9d079c">00300</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#976c57e474987e1c54a6921c1f9d079c" title="Sets pointer of prev subalbum.">Subalbum::setPrev</a>(<a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* val)
<a name="l00301"></a>00301 {
<a name="l00302"></a>00302   <a class="code" href="classSubalbum.html#54c5ce9ad52359e1a6f26517328c0ee2" title="Pointer to prev subalbum.">prevSubalbum</a> = val;
<a name="l00303"></a>00303   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00304"></a>00304 }
<a name="l00305"></a>00305 <span class="comment">//==============================================</span>
<a name="l00306"></a><a class="code" href="classSubalbum.html#b44668ea110a4ee38fb27e9fcb4b39f6">00306</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#b44668ea110a4ee38fb27e9fcb4b39f6" title="Sets pointer of next subalbum.">Subalbum::setNext</a>(<a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* val)
<a name="l00307"></a>00307 {
<a name="l00308"></a>00308   <a class="code" href="classSubalbum.html#6ac8347a1e335fcb4480fc63fdc8f9dc" title="Pointer to next subalbum.">nextSubalbum</a> = val;
<a name="l00309"></a>00309   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00310"></a>00310 }
<a name="l00311"></a>00311 <span class="comment">//==============================================</span>
<a name="l00312"></a><a class="code" href="classSubalbum.html#4b739ddec9d2b6421357a56553d91c82">00312</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#4b739ddec9d2b6421357a56553d91c82" title="Exports subalbum to xml.">Subalbum::exportToXML</a>(<a class="code" href="classStatusWidget.html">StatusWidget</a>*, QTextStream&amp; stream)
<a name="l00313"></a>00313 {
<a name="l00314"></a>00314   <span class="comment">//write subalbum information</span>
<a name="l00315"></a>00315   stream &lt;&lt; <span class="stringliteral">"  &lt;subalbum&gt;\n"</span>;
<a name="l00316"></a>00316 
<a name="l00317"></a>00317   <span class="comment">//if subalbum has a represenatative image save it's path</span>
<a name="l00318"></a>00318    <span class="keywordflow">if</span>(<a class="code" href="classSubalbum.html#9bd87802ff9f634579c35d4a399c1227" title="gets a sized representative image">getRepresentativeImage</a>(<a class="code" href="album_8h.html#c27c2124ca2aed651e06aba3a1468ecb">LARGE</a>) != NULL )
<a name="l00319"></a>00319    {
<a name="l00320"></a>00320      stream &lt;&lt; <span class="stringliteral">"    &lt;thumb path=\"img/"</span> &lt;&lt; <a class="code" href="classSubalbum.html#16e483535b3378a7e931f66d933d3e79" title="Subalbum Number.">number</a> &lt;&lt; <span class="stringliteral">"_thumb.jpg\"/&gt;\n"</span>;
<a name="l00321"></a>00321      stream &lt;&lt; <span class="stringliteral">"    &lt;name&gt;"</span> &lt;&lt; <a class="code" href="xmlTools_8cpp.html#fd193066f6b4f77436cd0f17146a1e39" title="Fix strings before exporting to XML such that &amp;amp; becomes &amp;amp;, etc...">fixXMLString</a>(<a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a>) &lt;&lt; <span class="stringliteral">"&lt;/name&gt;\n"</span>;
<a name="l00322"></a>00322    }
<a name="l00323"></a>00323    <span class="comment">//else if the name is empty or just whitespace override it with "Subalbum #" so</span>
<a name="l00324"></a>00324    <span class="comment">//it is not invisible on the coverpage</span>
<a name="l00325"></a>00325    <span class="keywordflow">else</span>
<a name="l00326"></a>00326    {
<a name="l00327"></a>00327      QString strippedName = <a class="code" href="xmlTools_8cpp.html#fd193066f6b4f77436cd0f17146a1e39" title="Fix strings before exporting to XML such that &amp;amp; becomes &amp;amp;, etc...">fixXMLString</a>(<a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a>);
<a name="l00328"></a>00328      <span class="keywordflow">if</span>(strippedName.stripWhiteSpace() == <span class="stringliteral">""</span>)
<a name="l00329"></a>00329        stream &lt;&lt; QString(<span class="stringliteral">"  &lt;name&gt;%1 %2&lt;/name&gt;\n"</span>).arg(qApp-&gt;translate(<span class="stringliteral">"Subalbum"</span>, <span class="stringliteral">"Collection"</span>)).arg(<a class="code" href="classSubalbum.html#16e483535b3378a7e931f66d933d3e79" title="Subalbum Number.">number</a>);
<a name="l00330"></a>00330      <span class="keywordflow">else</span>
<a name="l00331"></a>00331        stream &lt;&lt; <span class="stringliteral">"    &lt;name&gt;"</span> &lt;&lt; <a class="code" href="xmlTools_8cpp.html#fd193066f6b4f77436cd0f17146a1e39" title="Fix strings before exporting to XML such that &amp;amp; becomes &amp;amp;, etc...">fixXMLString</a>(<a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a>) &lt;&lt; <span class="stringliteral">"&lt;/name&gt;\n"</span>;
<a name="l00332"></a>00332    }
<a name="l00333"></a>00333 
<a name="l00334"></a>00334   stream &lt;&lt; <span class="stringliteral">"    &lt;description&gt;"</span> &lt;&lt; <a class="code" href="xmlTools_8cpp.html#fd193066f6b4f77436cd0f17146a1e39" title="Fix strings before exporting to XML such that &amp;amp; becomes &amp;amp;, etc...">fixXMLString</a>(<a class="code" href="classSubalbum.html#983620a2f934d2437314902a1782038c" title="Longer description of subalbum.">description</a>) &lt;&lt; <span class="stringliteral">"&lt;/description&gt;\n"</span>;
<a name="l00335"></a>00335 
<a name="l00336"></a>00336   <span class="comment">//write photos</span>
<a name="l00337"></a>00337   <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* current = <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a>;
<a name="l00338"></a>00338   <span class="keywordflow">while</span>(current != NULL)
<a name="l00339"></a>00339   {
<a name="l00340"></a>00340     current-&gt;<a class="code" href="classPhoto.html#32cb80c04e59656420094311ad6d9c20" title="Exports photo to xml.">exportToXML</a>(stream);
<a name="l00341"></a>00341     current = current-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>();
<a name="l00342"></a>00342   }
<a name="l00343"></a>00343 
<a name="l00344"></a>00344   <span class="comment">//close subalbum</span>
<a name="l00345"></a>00345   stream &lt;&lt; <span class="stringliteral">"  &lt;/subalbum&gt;\n"</span>;
<a name="l00346"></a>00346 
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 <span class="comment">//==============================================</span>
<a name="l00349"></a><a class="code" href="classSubalbum.html#c006384e8c28addecc09c23a591ea884">00349</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#c006384e8c28addecc09c23a591ea884" title="Builds subalbum from XML DOM node.">Subalbum::importFromDisk</a>(QDomNode* root, 
<a name="l00350"></a>00350                               <span class="keywordtype">int</span> subalbumNum,
<a name="l00351"></a>00351                               <a class="code" href="classStatusWidget.html">StatusWidget</a>* <a class="code" href="redEye__internal_8h.html#65b682074aef9e63bb1dad48c3e9e9df">status</a>,
<a name="l00352"></a>00352                               QString dirName, 
<a name="l00353"></a>00353                               <span class="keywordtype">bool</span> disableCheckPhotoMods)
<a name="l00354"></a>00354 {
<a name="l00355"></a>00355   <span class="comment">//if representative image exists load</span>
<a name="l00356"></a>00356   QString repName = QString(dirName + <span class="stringliteral">"/img/%1_thumb.jpg"</span>).arg(subalbumNum);
<a name="l00357"></a>00357   QImage repImage(repName);
<a name="l00358"></a>00358   <span class="keywordflow">if</span>(!repImage.isNull())
<a name="l00359"></a>00359   {
<a name="l00360"></a>00360     <a class="code" href="classSubalbum.html#61c23c492eef5def5d3aefa85e785433" title="sets a sized representative image">setRepresentativeImage</a>(repName);
<a name="l00361"></a>00361   }
<a name="l00362"></a>00362 
<a name="l00363"></a>00363   QDomNode node = root-&gt;firstChild();
<a name="l00364"></a>00364   QDomText val;
<a name="l00365"></a>00365   <span class="keywordtype">int</span> photoNum = 0;
<a name="l00366"></a>00366   <span class="keywordflow">while</span>( !node.isNull() )
<a name="l00367"></a>00367   {
<a name="l00368"></a>00368     <span class="comment">//------------------------------------------------------------</span>
<a name="l00369"></a>00369     <span class="comment">//subalbum name</span>
<a name="l00370"></a>00370     <span class="keywordflow">if</span>( node.isElement() &amp;&amp; node.nodeName() == <span class="stringliteral">"name"</span> )
<a name="l00371"></a>00371     {
<a name="l00372"></a>00372       val = node.firstChild().toText();
<a name="l00373"></a>00373       <span class="keywordflow">if</span>(!val.isNull())
<a name="l00374"></a>00374         <a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a> = val.nodeValue();
<a name="l00375"></a>00375      <a class="code" href="classSubalbum.html#2728b6ac73fbf30ce1e494a64bb6186d" title="Short Name for subalbum.">name</a>.replace(<span class="stringliteral">"\\&amp;quot;"</span>,<span class="stringliteral">"\""</span>);
<a name="l00376"></a>00376     }
<a name="l00377"></a>00377     <span class="comment">//------------------------------------------------------------</span>
<a name="l00378"></a>00378     <span class="comment">//subalbum description</span>
<a name="l00379"></a>00379     <span class="keywordflow">else</span> <span class="keywordflow">if</span>( node.isElement() &amp;&amp; node.nodeName() == <span class="stringliteral">"description"</span> )
<a name="l00380"></a>00380     {
<a name="l00381"></a>00381       val = node.firstChild().toText();
<a name="l00382"></a>00382       <span class="keywordflow">if</span>(!val.isNull())
<a name="l00383"></a>00383         <a class="code" href="classSubalbum.html#983620a2f934d2437314902a1782038c" title="Longer description of subalbum.">description</a> = val.nodeValue();
<a name="l00384"></a>00384      <a class="code" href="classSubalbum.html#983620a2f934d2437314902a1782038c" title="Longer description of subalbum.">description</a>.replace(<span class="stringliteral">"\\&amp;quot;"</span>,<span class="stringliteral">"\""</span>);
<a name="l00385"></a>00385     }
<a name="l00386"></a>00386     <span class="comment">//------------------------------------------------------------</span>
<a name="l00387"></a>00387     <span class="comment">//photo</span>
<a name="l00388"></a>00388     <span class="keywordflow">else</span> <span class="keywordflow">if</span>( node.isElement() &amp;&amp; node.nodeName() == <span class="stringliteral">"photo"</span> )
<a name="l00389"></a>00389     {
<a name="l00390"></a>00390       <span class="comment">//increase counter</span>
<a name="l00391"></a>00391       photoNum++;
<a name="l00392"></a>00392 
<a name="l00393"></a>00393       <span class="comment">//create new photo object</span>
<a name="l00394"></a>00394       QString imageName = QString(dirName + <span class="stringliteral">"img/%1/%2.jpg"</span>).arg(subalbumNum).arg(photoNum);
<a name="l00395"></a>00395       QString slideshowName = QString(dirName + <span class="stringliteral">"img/%1/%2_slideshow.jpg"</span>).arg(subalbumNum).arg(photoNum);
<a name="l00396"></a>00396       QString thumbName = QString(dirName + <span class="stringliteral">"img/%1/%2_thumb.jpg"</span>).arg(subalbumNum).arg(photoNum);
<a name="l00397"></a>00397       <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* newPhoto = <span class="keyword">new</span> <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>(<span class="keyword">this</span>, <a class="code" href="classSubalbum.html#22578a064d4c60f3bba4b0e8d314ce42" title="Returns last photo in subalbum.">getLast</a>(), photoNum);
<a name="l00398"></a>00398 
<a name="l00399"></a>00399       <span class="comment">//load photo information from disk</span>
<a name="l00400"></a>00400       QDateTime* modificationTimes = newPhoto-&gt;<a class="code" href="classPhoto.html#175031feb8124b3aa22d6145cd45cf4f" title="Builds photo from XML DOM node, returns date modified info from xml.">importFromDisk</a>( &amp;node );
<a name="l00401"></a>00401 
<a name="l00402"></a>00402       <span class="comment">//first check to see if modifications times have changed</span>
<a name="l00403"></a>00403       <span class="keywordtype">bool</span> lazyLoad = <span class="keyword">true</span>; <span class="comment">//assume no modifications</span>
<a name="l00404"></a>00404 
<a name="l00405"></a>00405       <span class="comment">//skip checking for mods if disable checking is set</span>
<a name="l00406"></a>00406       <span class="keywordflow">if</span>(!disableCheckPhotoMods)
<a name="l00407"></a>00407       {
<a name="l00408"></a>00408         QFileInfo info[3];
<a name="l00409"></a>00409         info[0].setFile( imageName );
<a name="l00410"></a>00410         info[1].setFile( slideshowName );
<a name="l00411"></a>00411         info[2].setFile( thumbName );
<a name="l00412"></a>00412         <span class="keywordflow">if</span>(
<a name="l00413"></a>00413               modificationTimes[0] != info[0].lastModified() ||
<a name="l00414"></a>00414               modificationTimes[1] != info[1].lastModified() ||
<a name="l00415"></a>00415               modificationTimes[2] != info[2].lastModified()
<a name="l00416"></a>00416            )
<a name="l00417"></a>00417           lazyLoad = <span class="keyword">false</span>;
<a name="l00418"></a>00418       }
<a name="l00419"></a>00419 
<a name="l00420"></a>00420       <span class="comment">//if no changes have occured do lazy load - don't</span>
<a name="l00421"></a>00421       <span class="comment">//bother scaling down thumbnail and slideshow images</span>
<a name="l00422"></a>00422       <span class="comment">//from original image</span>
<a name="l00423"></a>00423       std::ifstream imageFile    ( QFile::encodeName(imageName)     );
<a name="l00424"></a>00424       std::ifstream slideshowFile( QFile::encodeName(slideshowName) );
<a name="l00425"></a>00425       std::ifstream thumbnailFile( QFile::encodeName(thumbName)     );
<a name="l00426"></a>00426 
<a name="l00427"></a>00427       <span class="keywordflow">if</span>(  imageFile.is_open() &amp;&amp;
<a name="l00428"></a>00428             thumbnailFile.is_open() &amp;&amp;
<a name="l00429"></a>00429             slideshowFile.is_open() &amp;&amp;
<a name="l00430"></a>00430            (
<a name="l00431"></a>00431               lazyLoad ||
<a name="l00432"></a>00432               (
<a name="l00433"></a>00433                 <a class="code" href="md5_8cpp.html#899b2fb35bd6d33506dde3eb0d87a761">getMD5</a>(imageFile) == newPhoto-&gt;<a class="code" href="classPhoto.html#bc9851216524158d20580556219424a7" title="Get image checksum.">getImageChecksum</a>() &amp;&amp;
<a name="l00434"></a>00434                 <a class="code" href="md5_8cpp.html#899b2fb35bd6d33506dde3eb0d87a761">getMD5</a>(slideshowFile) == newPhoto-&gt;<a class="code" href="classPhoto.html#b4adadc959070279d7ab7dfc1a030c23" title="Get thumbanil checksum.">getSlideshowChecksum</a>() &amp;&amp;
<a name="l00435"></a>00435                 <a class="code" href="md5_8cpp.html#899b2fb35bd6d33506dde3eb0d87a761">getMD5</a>(thumbnailFile) == newPhoto-&gt;<a class="code" href="classPhoto.html#580439da79d239dba26e6f21abadbaf4" title="Get thumbanil checksum.">getThumbnailChecksum</a>()
<a name="l00436"></a>00436               )
<a name="l00437"></a>00437            )
<a name="l00438"></a>00438         )
<a name="l00439"></a>00439       {
<a name="l00440"></a>00440         <span class="comment">//close ifstreams</span>
<a name="l00441"></a>00441         imageFile.close();
<a name="l00442"></a>00442         slideshowFile.close();
<a name="l00443"></a>00443         thumbnailFile.close();
<a name="l00444"></a>00444 
<a name="l00445"></a>00445         <span class="comment">//populate image</span>
<a name="l00446"></a>00446         <a class="code" href="classSubalbum.html#4380016d07f980852e03ccf18ef65dff" title="Lazily adds a new photo to the subalbum without rescaling from scrath, returns TRUE...">lazyAddPhoto</a>(imageName, slideshowName, thumbName, newPhoto);
<a name="l00447"></a>00447       }
<a name="l00448"></a>00448       <span class="comment">//else reload image and scale it since changes have occured.</span>
<a name="l00449"></a>00449       <span class="keywordflow">else</span>
<a name="l00450"></a>00450       {
<a name="l00451"></a>00451         <span class="comment">//close ifstreams if open</span>
<a name="l00452"></a>00452         <span class="keywordflow">if</span>(imageFile.is_open())
<a name="l00453"></a>00453           imageFile.close();
<a name="l00454"></a>00454         <span class="keywordflow">if</span>(thumbnailFile.is_open())
<a name="l00455"></a>00455           thumbnailFile.close();
<a name="l00456"></a>00456 
<a name="l00457"></a>00457         <span class="comment">//populate image</span>
<a name="l00458"></a>00458         <a class="code" href="classSubalbum.html#12db5ef063152af51a8ded94d7bee730" title="Adds a new photo to the Subalbum and appends it to the end, returns TRUE if successful...">addPhoto</a>(imageName, <span class="keyword">false</span>, newPhoto);
<a name="l00459"></a>00459       }
<a name="l00460"></a>00460 
<a name="l00461"></a>00461       <span class="keywordflow">if</span>(imageFile.is_open())
<a name="l00462"></a>00462         imageFile.close();
<a name="l00463"></a>00463       <span class="keywordflow">if</span>(slideshowFile.is_open())
<a name="l00464"></a>00464         slideshowFile.close();
<a name="l00465"></a>00465       <span class="keywordflow">if</span>(thumbnailFile.is_open())
<a name="l00466"></a>00466         thumbnailFile.close();
<a name="l00467"></a>00467 
<a name="l00468"></a>00468       <span class="comment">//update progress bar</span>
<a name="l00469"></a>00469       status-&gt;<a class="code" href="classStatusWidget.html#de18735223ae40506c32c96b9c9c5476" title="Updates the progress bar by one step.">incrementProgress</a>();
<a name="l00470"></a>00470       qApp-&gt;processEvents();
<a name="l00471"></a>00471     }
<a name="l00472"></a>00472     <span class="comment">//------------------------------------------------------------</span>
<a name="l00473"></a>00473     <span class="comment">//advance to next node</span>
<a name="l00474"></a>00474     node = node.nextSibling();
<a name="l00475"></a>00475     <span class="comment">//------------------------------------------------------------</span>
<a name="l00476"></a>00476   }
<a name="l00477"></a>00477   <span class="comment">//------------------------------------------------------------</span>
<a name="l00478"></a>00478   <span class="comment">//set loaded number</span>
<a name="l00479"></a>00479   <a class="code" href="classSubalbum.html#a93dcf1d9ca349da4cbe39a0c569c37b">resetNumLoadedPhotos</a>();
<a name="l00480"></a>00480   <span class="comment">//------------------------------------------------------------</span>
<a name="l00481"></a>00481 }
<a name="l00482"></a>00482 <span class="comment">//==============================================</span>
<a name="l00483"></a><a class="code" href="classSubalbum.html#77b6f10b6c8e2230185ae9a5c30c8300">00483</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#77b6f10b6c8e2230185ae9a5c30c8300" title="Removes a specified photo without deleting the object.">Subalbum::photoMoved</a>(<a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* val)
<a name="l00484"></a>00484 {
<a name="l00485"></a>00485   <span class="comment">//if null pointer bail</span>
<a name="l00486"></a>00486   <span class="keywordflow">if</span>(val == NULL) <span class="keywordflow">return</span>;
<a name="l00487"></a>00487   
<a name="l00488"></a>00488   <span class="comment">//update first and last pointers if necessary</span>
<a name="l00489"></a>00489   <span class="keywordflow">if</span>(val == <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a>) <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>();
<a name="l00490"></a>00490   <span class="keywordflow">if</span>(val == <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>)  <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>  = val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>();
<a name="l00491"></a>00491 
<a name="l00492"></a>00492   <span class="comment">//splice out</span>
<a name="l00493"></a>00493   <span class="keywordflow">if</span>(val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>() != NULL) val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>()-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>( val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>() );
<a name="l00494"></a>00494   <span class="keywordflow">if</span>(val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>() != NULL) val-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>()-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>( val-&gt;<a class="code" href="classPhoto.html#9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>() );
<a name="l00495"></a>00495 
<a name="l00496"></a>00496   <a class="code" href="classSubalbum.html#11f56eda8419db70fb88a15fbe46938e" title="Number of photos in subalbum.">numPhotos</a>--;
<a name="l00497"></a>00497   <a class="code" href="classSubalbum.html#662929e1d71c43a120bf59e04477f6b3" title="Pointer to album subalbum is in.">albm</a>-&gt;<a class="code" href="classAlbum.html#93ca31d42cb8ba9a9d07f5a01a090def" title="Sets the album as modified.">setModified</a>();
<a name="l00498"></a>00498 }
<a name="l00499"></a>00499 <span class="comment">//==============================================</span>
<a name="l00500"></a><a class="code" href="classSubalbum.html#f491dd129feb2e0713c3cc943e3d3fed">00500</a> <span class="keywordtype">void</span> <a class="code" href="classSubalbum.html#f491dd129feb2e0713c3cc943e3d3fed" title="Syncs photo ordering with front end gui ordering.">Subalbum::syncPhotoList</a>(<a class="code" href="classPhotoPreviewWidget.html" title="Displays photo thumbnail and description.">PhotoPreviewWidget</a>* item)
<a name="l00501"></a>00501 {
<a name="l00502"></a>00502   <span class="comment">//base case, no items</span>
<a name="l00503"></a>00503   <span class="keywordflow">if</span>(item == NULL)
<a name="l00504"></a>00504   {
<a name="l00505"></a>00505     <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = NULL;
<a name="l00506"></a>00506     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = NULL;
<a name="l00507"></a>00507     <span class="keywordflow">return</span>;
<a name="l00508"></a>00508   }
<a name="l00509"></a>00509 
<a name="l00510"></a>00510   <span class="comment">//set first and last pointers</span>
<a name="l00511"></a>00511   <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a> = item-&gt;<a class="code" href="classPhotoPreviewWidget.html#f54da3447e6426891f5a1a40a0e3e1a7" title="Returns photo pointer.">getPhoto</a>();
<a name="l00512"></a>00512   <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a>-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>(NULL);
<a name="l00513"></a>00513   <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a>-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>(NULL);
<a name="l00514"></a>00514   <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = <a class="code" href="classSubalbum.html#9191766b1a9af28f332fac828a93cd89" title="Pointer to first photo.">firstPhoto</a>;
<a name="l00515"></a>00515 
<a name="l00516"></a>00516   <span class="comment">//set all next/prev pointers</span>
<a name="l00517"></a>00517   <span class="keywordflow">while</span>(item-&gt;nextItem() != NULL)
<a name="l00518"></a>00518   {
<a name="l00519"></a>00519     item-&gt;<a class="code" href="classPhotoPreviewWidget.html#f54da3447e6426891f5a1a40a0e3e1a7" title="Returns photo pointer.">getPhoto</a>()-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>( ((<a class="code" href="classPhotoPreviewWidget.html" title="Displays photo thumbnail and description.">PhotoPreviewWidget</a>*)item-&gt;nextItem())-&gt;getPhoto() );
<a name="l00520"></a>00520     item-&gt;<a class="code" href="classPhotoPreviewWidget.html#f54da3447e6426891f5a1a40a0e3e1a7" title="Returns photo pointer.">getPhoto</a>()-&gt;<a class="code" href="classPhoto.html#357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>()-&gt;<a class="code" href="classPhoto.html#7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>( item-&gt;<a class="code" href="classPhotoPreviewWidget.html#f54da3447e6426891f5a1a40a0e3e1a7" title="Returns photo pointer.">getPhoto</a>() );
<a name="l00521"></a>00521     item = (<a class="code" href="classPhotoPreviewWidget.html" title="Displays photo thumbnail and description.">PhotoPreviewWidget</a>*)item-&gt;nextItem();
<a name="l00522"></a>00522     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a> = item-&gt;<a class="code" href="classPhotoPreviewWidget.html#f54da3447e6426891f5a1a40a0e3e1a7" title="Returns photo pointer.">getPhoto</a>();
<a name="l00523"></a>00523     <a class="code" href="classSubalbum.html#71607e559d5f71793ca8798d0737c7d8" title="Pointer to last photo.">lastPhoto</a>-&gt;<a class="code" href="classPhoto.html#6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>(NULL);
<a name="l00524"></a>00524   }
<a name="l00525"></a>00525   
<a name="l00526"></a>00526 }
<a name="l00527"></a>00527 <span class="comment">//==============================================</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:27 2009 for AlbumShaper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>