Summary: | Search by content only searches in files whose mime type begins with "text/" | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Mariusz <fisiu82> |
Component: | search | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | cyberbeat, fisiu82, hrvoje.senjan |
Priority: | NOR | Keywords: | investigated |
Version: | 4.12.3 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kde-baseapps/c52ba9446b05e6bc7f890daac406659a9c37c562 | Version Fixed In: | 4.12.4 |
Sentry Crash Report: |
Description
Mariusz
2014-03-14 15:37:37 UTC
Thanks for the bug report. I can confirm this. The problem is that we only search the text inside files which have a mime type that begins with "text/". All your files that contain "#!/usr/bin/env bash" at the beginning have the mime type "shell script" and are not considered as text files. I'm not sure what to do about this. I would prefer not to maintain a Dolphin-internal list of mime types that usually contain plain text... (and such a list would not help at all, because it would only work if Nepomuk is disabled, and the Dolphin-internal 'filenamesearch' is used). And how krusader does handle searching by content? Maybe theirs solution applies. Ah, I just looked through the API docs - it seems that we can use mime type inheritance, like KFileItem item(....); if (item.determineMimeType()->is("text/plain")) { // Check if the file contains the text... } Probably Krusader uses the same solution (or they search in all files). I have a patch that fixes the problem for me: https://git.reviewboard.kde.org/r/116805/ @Hrvoje: I see that you read this report. Should a separate report be filed for Nepomuk/Baloo? (In reply to comment #4) > @Hrvoje: I see that you read this report. Should a separate report be filed > for Nepomuk/Baloo? You mean is the same bug valid with nepomuk/baloo on ? At the moment i have downgraded from 4.13 to 4.12 due to some issues, and i am normally not using nepomuk. i can try to activate it and test with another user if needed ;-) Git commit c52ba9446b05e6bc7f890daac406659a9c37c562 by Frank Reininghaus. Committed on 16/03/2014 at 17:02. Pushed by freininghaus into branch 'KDE/4.12'. Use MIME type inheritance to find out if a file contains text Before this commit, filenamesearch checked if a file's MIME type begins with "text/" to determine if its content can be searched. This prevented that text inside shell scripts is found. REVIEW: 116805 FIXED-IN: 4.12.4 M +4 -1 dolphin/src/search/filenamesearchprotocol.cpp http://commits.kde.org/kde-baseapps/c52ba9446b05e6bc7f890daac406659a9c37c562 (In reply to comment #5) > (In reply to comment #4) > > @Hrvoje: I see that you read this report. Should a separate report be filed > > for Nepomuk/Baloo? > > You mean is the same bug valid with nepomuk/baloo on ? According to comment 0, yes, but I haven't tested it myself. *** Bug 314607 has been marked as a duplicate of this bug. *** |