[Digikam-devel] [Bug 132011] Add search criteria to take sub-tags into account
Marcel Wiesweg
marcel.wiesweg at gmx.de
Mon Aug 7 21:58:09 BST 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=132011
marcel.wiesweg gmx de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From marcel.wiesweg gmx de 2006-08-07 22:58 -------
SVN commit 570853 by mwiesweg:
Applying proposed patch. Thanks to Richard Kralovic.
BUG: 132011
M +2 -0 digikam/searchwidgets.cpp
M +15 -1 kioslave/digikamsearch.cpp
--- trunk/extragear/graphics/digikam/digikam/searchwidgets.cpp #570852:570853
@ -95,6 +95,8 @
{ I18N_NOOP("Does Not Equal"), "NE", SearchAdvancedRule::ALBUMS },
{ I18N_NOOP("Equals"), "EQ", SearchAdvancedRule::TAGS },
{ I18N_NOOP("Does Not Equal"), "NE", SearchAdvancedRule::TAGS },
+ { I18N_NOOP("Contains"), "LIKE", SearchAdvancedRule::TAGS },
+ { I18N_NOOP("Does Not Contain"), "NLIKE", SearchAdvancedRule::TAGS },
{ I18N_NOOP("After"), "GT", SearchAdvancedRule::DATE },
{ I18N_NOOP("Before"), "LT", SearchAdvancedRule::DATE },
{ I18N_NOOP("Equals"), "EQ", SearchAdvancedRule::DATE },
--- trunk/extragear/graphics/digikam/kioslave/digikamsearch.cpp #570852:570853
@ -471,14 +471,26 @
query = " (Images.id IN "
" (SELECT imageid FROM ImageTags "
" WHERE tagid = $$ $$)) ";
- else
+ else if (op == NE)
query = " (Images.id NOT IN "
" (SELECT imageid FROM ImageTags "
" WHERE tagid = $$ $$)) ";
+ else if (op == LIKE)
+ query = " (Images.id IN "
+ " (SELECT ImageTags.imageid FROM ImageTags JOIN TagsTree on ImageTags.tagid = TagsTree.id "
+ " WHERE TagsTree.pid = $$ $$ or ImageTags.tagid = $$ $$ )) ";
+ else // op == NLIKE
+ query = " (Images.id NOT IN "
+ " (SELECT ImageTags.imageid FROM ImageTags JOIN TagsTree on ImageTags.tagid = TagsTree.id "
+ " WHERE TagsTree.pid = $$ $$ or ImageTags.tagid = $$ $$ )) ";
// query = " (Images.id IN "
// " (SELECT imageid FROM ImageTags "
// " WHERE tagid $$##$$ $$ $$)) ";
+
+ query.replace("$$ $$", QString::fromLatin1("'") + escapeString(val)
+ + QString::fromLatin1("'"));
+
break;
}
case(TAGNAME):
@ -516,6 +528,7 @
}
}
+ if (key != TAG) {
switch (op)
{
case(EQ):
@ -561,6 +574,7 @
break;
}
}
+ }
// special case for imagedate. If the key is imagedate and the operator is EQ,
// we need to split it into two rules
More information about the Digikam-devel
mailing list