Summary: | Add search criteria to take sub-tags into account | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Richard Kralovic <riso> |
Component: | Searches-Advanced | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 0.8.2 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.0 | |
Sentry Crash Report: | |||
Attachments: | Proposed patch to solve the feature request. |
Description
Richard Kralovic
2006-08-07 17:37:02 UTC
Created attachment 17267 [details]
Proposed patch to solve the feature request.
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 |