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

« back to all changes in this revision

Viewing changes to digikam/searchmodificationhelper.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-08-26 19:25:16 UTC
  • mfrom: (1.2.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100826192516-mkbdww0h5v2x4yoy
Tags: 2:1.4.0-0ubuntu1
* New upstream bugfix release (LP: #626751)
* Install the file NEWS as upstream changelog because "ChangeLog" is
  too verbose.
* Don't copy the desktop .pot file to imageplugins, not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Date        : 2000-12-05
7
7
 * Description : helper class used to modify search albums in views
8
8
 *
9
 
 * Copyright (C) 2009 by Johannes Wienke <languitar at semipol dot de>
 
9
 * Copyright (C) 2009-2010 by Johannes Wienke <languitar at semipol dot de>
10
10
 *
11
11
 * This program is free software; you can redistribute it
12
12
 * and/or modify it under the terms of the GNU General
42
42
namespace Digikam
43
43
{
44
44
 
45
 
class SearchModificationHelperPriv
 
45
class SearchModificationHelper::SearchModificationHelperPriv
46
46
{
47
47
public:
48
48
 
51
51
    {
52
52
    }
53
53
 
54
 
    QWidget *dialogParent;
 
54
    QWidget* dialogParent;
55
55
};
56
56
 
57
 
SearchModificationHelper::SearchModificationHelper(QObject *parent,
58
 
                QWidget *dialogParent) : QObject(parent),
59
 
                d(new SearchModificationHelperPriv)
 
57
SearchModificationHelper::SearchModificationHelper(QObject* parent, QWidget* dialogParent)
 
58
                        : QObject(parent), d(new SearchModificationHelperPriv)
60
59
{
61
60
    d->dialogParent = dialogParent;
62
61
}
66
65
    delete d;
67
66
}
68
67
 
69
 
void SearchModificationHelper::slotSearchDelete(SAlbum *searchAlbum)
 
68
void SearchModificationHelper::slotSearchDelete(SAlbum* searchAlbum)
70
69
{
71
70
    if (!searchAlbum)
72
71
    {
90
89
    AlbumManager::instance()->deleteSAlbum(searchAlbum);
91
90
}
92
91
 
93
 
bool SearchModificationHelper::checkAlbum(const QString &name) const
 
92
bool SearchModificationHelper::checkAlbum(const QString& name) const
94
93
{
95
94
    const AlbumList list = AlbumManager::instance()->allSAlbums();
96
95
 
105
104
    return true;
106
105
}
107
106
 
108
 
bool SearchModificationHelper::checkName(QString &name)
 
107
bool SearchModificationHelper::checkName(QString& name)
109
108
{
110
109
    bool checked = checkAlbum(name);
111
110
 
128
127
    return true;
129
128
}
130
129
 
131
 
void SearchModificationHelper::slotSearchRename(SAlbum *searchAlbum)
 
130
void SearchModificationHelper::slotSearchRename(SAlbum* searchAlbum)
132
131
{
133
132
    if (!searchAlbum)
134
133
    {
155
154
                                           name);
156
155
}
157
156
 
158
 
void SearchModificationHelper::slotCreateTimeLineSearch(const QString &desiredName,
159
 
                                                        const DateRangeList &dateRanges,
 
157
void SearchModificationHelper::slotCreateTimeLineSearch(const QString& desiredName,
 
158
                                                        const DateRangeList& dateRanges,
160
159
                                                        bool overwriteIfExisting)
161
160
{
162
161
    QString name = desiredName;
194
193
 
195
194
}
196
195
 
197
 
SAlbum *SearchModificationHelper::createFuzzySearchFromSketch(
198
 
                const QString& proposedName, SketchWidget *sketchWidget,
199
 
                unsigned int numberOfResults, bool overwriteIfExisting)
 
196
SAlbum* SearchModificationHelper::createFuzzySearchFromSketch(const QString& proposedName,
 
197
                                                              SketchWidget* sketchWidget,
 
198
                                                              unsigned int numberOfResults,
 
199
                                                              bool overwriteIfExisting)
200
200
{
201
 
 
202
201
    if (sketchWidget->isClear())
203
202
    {
204
203
        return 0;
230
229
    AlbumManager::instance()->setCurrentAlbum(salbum);
231
230
 
232
231
    return salbum;
233
 
 
234
 
}
235
 
 
236
 
void SearchModificationHelper::slotCreateFuzzySearchFromSketch(
237
 
                const QString& proposedName, SketchWidget *sketchWidget,
238
 
                unsigned int numberOfResults, bool overwriteIfExisting)
239
 
{
240
 
    createFuzzySearchFromSketch(proposedName, sketchWidget, numberOfResults,
241
 
                    overwriteIfExisting);
242
 
}
243
 
 
244
 
SAlbum *SearchModificationHelper::createFuzzySearchFromImage(
245
 
                const QString &proposedName, const ImageInfo &image,
246
 
                float threshold, bool overwriteIfExisting)
247
 
{
248
 
 
 
232
}
 
233
 
 
234
void SearchModificationHelper::slotCreateFuzzySearchFromSketch(const QString& proposedName,
 
235
                                                               SketchWidget* sketchWidget,
 
236
                                                               unsigned int numberOfResults,
 
237
                                                               bool overwriteIfExisting)
 
238
{
 
239
    createFuzzySearchFromSketch(proposedName, sketchWidget, numberOfResults, overwriteIfExisting);
 
240
}
 
241
 
 
242
SAlbum* SearchModificationHelper::createFuzzySearchFromImage(const QString& proposedName,
 
243
                                                             const ImageInfo& image,
 
244
                                                             float threshold,
 
245
                                                             bool overwriteIfExisting)
 
246
{
249
247
    if (image.isNull())
250
248
    {
251
249
        return 0;
275
273
    AlbumManager::instance()->setCurrentAlbum(salbum);
276
274
 
277
275
    return salbum;
278
 
 
279
276
}
280
277
 
281
 
void SearchModificationHelper::slotCreateFuzzySearchFromImage(
282
 
                const QString &proposedName, const ImageInfo &image,
283
 
                float threshold, bool overwriteIfExisting)
 
278
void SearchModificationHelper::slotCreateFuzzySearchFromImage(const QString& proposedName,
 
279
                                                              const ImageInfo& image,
 
280
                                                              float threshold,
 
281
                                                              bool overwriteIfExisting)
284
282
{
285
 
    createFuzzySearchFromImage(proposedName, image, threshold,
286
 
                    overwriteIfExisting);
 
283
    createFuzzySearchFromImage(proposedName, image, threshold, overwriteIfExisting);
287
284
}
288
285
 
289
 
}
 
286
} // namespace Digikam