~ubuntu-branches/ubuntu/karmic/digikam/karmic

« back to all changes in this revision

Viewing changes to utilities/fuzzysearch/fuzzysearchfolderview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Luka Renko
  • Date: 2009-02-14 17:52:28 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20090214175228-axs6z8e5pgg7bqfx
Tags: 2:0.10.0~rc2-0ubuntu1
* New upstream release (release candidate 2)
* patches/01-kubuntu-fix-armel.patch: 
  - Dropped, included upstream
* control: 
  - Remove quilt from build-depends (no patches)
  - Add liblensfun-dev to build-depends (now in main)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Date        : 2008-05-27
7
7
 * Description : Fuzzy search folder view
8
8
 *
9
 
 * Copyright (C) 2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
9
 * Copyright (C) 2008-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2009 by Andi Clemens <andi dot clemens at gmx dot net>
10
11
 *
11
12
 * This program is free software; you can redistribute it
12
13
 * and/or modify it under the terms of the GNU General
33
34
 
34
35
// KDE includes.
35
36
 
 
37
#include <kdebug.h>
36
38
#include <kmenu.h>
37
39
#include <klocale.h>
38
40
#include <kglobal.h>
120
122
 
121
123
FuzzySearchFolderView::~FuzzySearchFolderView()
122
124
{
 
125
    saveViewState();
123
126
}
124
127
 
125
128
QString FuzzySearchFolderView::currentFuzzySketchSearchName()
143
146
        SAlbum* salbum                  = (SAlbum*)(*it);
144
147
        FuzzySearchFolderItem* viewItem = (FuzzySearchFolderItem*) salbum->extraData(this);
145
148
 
146
 
        if (salbum->title().contains(search, settings.caseSensitive) &&
147
 
            salbum->isHaarSearch() &&
148
 
            salbum->title() != currentFuzzySketchSearchName() &&
149
 
            salbum->title() != currentFuzzyImageSearchName())
 
149
        if (viewItem &&
 
150
            viewItem->text(0).contains(search, settings.caseSensitive))
150
151
        {
151
152
            atleastOneMatch = true;
152
153
 
290
291
    popmenu.addTitle(SmallIcon("digikam"), i18n("My Fuzzy Searches"));
291
292
    QAction *renSearch = popmenu.addAction(SmallIcon("edit-rename"), i18n("Rename..."));
292
293
    QAction *delSearch = popmenu.addAction(SmallIcon("edit-delete"), i18n("Delete"));
 
294
 
 
295
    if (sItem->album()->title() == currentFuzzySketchSearchName() ||
 
296
        sItem->album()->title() == currentFuzzyImageSearchName())
 
297
    {
 
298
        renSearch->setEnabled(false);
 
299
        delSearch->setEnabled(false);
 
300
    }
 
301
 
293
302
    QAction *choice    = popmenu.exec(QCursor::pos());
294
303
    if (choice)
295
304
    {