#8975 closed bug (fixed)
[TextSearch] Wrongly adds entries for newly created, empty files
Reported by: | x-ist | Owned by: | stippi |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/TextSearch | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Tested on hrevr1alpha4-44594.
- Start TextSearch from Desktop
- Search for "xyz" or something else
- Launch Terminal from Desktop
- Perform:
touch "test.txt"
- TextSearch wrongly adds the new empty file to the list.
Attachments (1)
Change History (14)
comment:1 by , 12 years ago
patch: | 0 → 1 |
---|
comment:2 by , 12 years ago
follow-up: 5 comment:4 by , 12 years ago
No, the patch is wrong, sorry. You removed the feature of reporting negatives, which seems to be necessary to remove files from the list which no longer contain matches. I'll have a look if I can fix it. I think the original version was almost fine, except for sending the message twice.
comment:5 by , 12 years ago
Sorry, it seems I misunderstood the semantics. During testing it didn't have any effect, which is not the case actually - as I see now. Apart from that, renaming a previously matched file seems not to be handled correctly as well.
follow-up: 7 comment:6 by , 12 years ago
In the original version, the first message MSG_REPORT_FILE_NAME is just an information that this file is now being processed. Think of the status bar informing of the files being scanned. Then there is a message MSG_REPORT_RESULT, which may or may not be sent for that same file. If the file contains the search string, it is sent with the "text" string field(s) containing the search hit line(s). If the file is a negative, then the message is being sent if the "iterator" is configured to "notify negatives" (and it won't contain a single "text" field).
Both the first thing (status report) and the "negatives" reporting is what your patch breaks. With these semantics in mind, it looks to me like the Grepper loop works as intended without your patch. And I think the problem must be on the receiving end. If you have more time to look into it, it is much appreciated. I remember this bug having annoyed me as well. Thanks for your help! I can try to look into it, too, but I don't know how much time I will have in the near future.
comment:7 by , 12 years ago
Replying to stippi:
First of all, thanks for the explanation.
And I think the problem must be on the receiving end.
You're totaly right, the Grepper loop is correct. The actual problem is a missing early return in GrepWindow::_OnReportResult(BMessage* message). The refreshed patch adds that.
comment:9 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | in-progress → closed |
Perfect, thanks! Committed to master. At first I thought the BListItem is leaked, but that's not the case.
follow-up: 13 comment:10 by , 12 years ago
Ah, now the hrev shows up. hrev44675. Is there any other way to know which revision tag a commit received other than looking at http://cgit.haiku-os.org/haiku/ ?
comment:12 by , 12 years ago
Ah, nothing. It's just my old workflow used to be: commit, copy revision number from svn output, paste into ticket, close ticket... ;-)
comment:13 by , 12 years ago
Replying to stippi:
Ah, now the hrev shows up. hrev44675. Is there any other way to know which revision tag a commit received other than looking at http://cgit.haiku-os.org/haiku/ ?
You can pull after pushing, the new revision tag will be retrieved.
Another situation where that bug really disturbs is:
I suppose that happens due to attributes being written to the files.