Summary: | Selecting multiple word tags in gwenview doesn't work | ||
---|---|---|---|
Product: | [Applications] gwenview | Reporter: | Mike Bridge <mike> |
Component: | general | Assignee: | Gwenview Bugs <gwenview-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hein, thelwyn, trueg |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Patch for the tag with quote problem in gwenview |
Description
Mike Bridge
2009-12-28 16:26:35 UTC
I think the place to fix this is in /trunk/KDE/kdegraphics/gwenview/app/startpage.cpp line 193. Yup, looks like the right line. However rather than surrounding the the tag name with quotation marks the right way to go about it would probably be to url-encode it (i.e. the space becomes %20 and so on) using QUrl::toPercentEncoding. Hi FYI:I just tested and can reproduce it with Ernest Tubb's as tag. But if I tag a picture with "test tag" (without the quotes), it works fine. My guess is that it's not especially related to multiple words, but to the quote inside your tag. Still, maybe the fix proposed by Eike would work fine. I'm about to test it (trunk currently building). Regards @Thomas: nepomuksearch:/hastag:"Ernest Tubb's" <-- this is really working in Dolphin for you? Here it's not. The right way to fix this is to not use strings in the first place. Gwenview already loads the tags. Thus, it has Nepomuk::Tag instances for all tags. Simply use the resourceUris() or in KDE 4.4 do: Nepomuk::Query::ComparisonTerm(Soprano::Vocabulary::NAO::hasTag(), Nepomuk::Query::ResourceTerm(tag))); And put that in a Nepomuk::Query::FileQuery. Created attachment 42188 [details]
Patch for the tag with quote problem in gwenview
Using the resourceUri the search went indeed good. Here is a patch.
@Sebastian: i didn't find the instances of Tag so I generated it from the data I found. Seems to work fine. Where would be the tags?
@Aurelien: even if this allow the search on tag with quote to work, it has a difference with the current method: the "shortcut" generated on startpage after a search is a file with a resourceUri as name instead of "hasTag:/something". Which is less readable...
The patch looks very good. It uses a trick but that is perfectly fine since the nepomuk KIO slave handles tags as special cases. To get proper names I think it would be sufficient to use KFileItem::text() in the history model. Then, at least the history folders would use the name of the tag rather than the resource URI. But be aware that you need to do a KIO::stat in order to get that information. Patch commited against trunk: http://websvn.kde.org/trunk/KDE/kdegraphics/gwenview/app/startpage.cpp?r1=1059546&r2=1110588 |