~ubuntu-branches/ubuntu/natty/digikam/natty

« back to all changes in this revision

Viewing changes to libs/models/imagealbumfiltermodel.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-07-26 22:11:35 UTC
  • mfrom: (1.2.22 upstream) (3.2.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090726221135-890tb3z3dqr2lkr6
Tags: 2:1.0.0~beta3-1ubuntu1
* Merge with debian unstable, remaining changes:
  - Export .pot name and copy to plugins in debian/rules
  - Remove liblqr-1-0-dev from build-deps, not in main

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
            PAlbum *rightAlbum = AlbumManager::instance()->findPAlbum(rightAlbumId);
115
115
            if (!leftAlbum || !rightAlbum)
116
116
                return -1;
 
117
            if (leftAlbum == rightAlbum)
 
118
                return 0;
117
119
            if (d->sorter.sortRole == ImageSortSettings::SortByCreationDate ||
118
120
                d->sorter.sortRole == ImageSortSettings::SortByModificationDate)
119
121
            {
 
122
                // Here we want to sort the _categories_ by _album_ date if images are sorted by date
 
123
                // We must still make sure that categorization is unique!
120
124
                QDate leftDate = leftAlbum->date();
121
125
                QDate rightDate = rightAlbum->date();
122
 
                int result;
123
 
                if (leftDate == rightDate)
124
 
                    result = 0;
125
 
                else if (leftDate < rightDate)
126
 
                    result = -1;
127
 
                else
128
 
                    result = 1;
129
 
                return ImageSortSettings::compareByOrder(result, d->sorter.currentSortOrder);
 
126
                if (leftDate != rightDate)
 
127
                {
 
128
                    int result;
 
129
                    if (leftDate == rightDate)
 
130
                        result = 0;
 
131
                    else if (leftDate < rightDate)
 
132
                        result = -1;
 
133
                    else
 
134
                        result = 1;
 
135
                    return ImageSortSettings::compareByOrder(result, d->sorter.currentSortOrder);
 
136
                }
130
137
            }
131
138
 
132
139
            return ImageSortSettings::naturalCompare(leftAlbum->albumPath(), rightAlbum->albumPath(),