FS#19367 - [kdewebdev-kfilereplace] doesn't search multiple filters/directories

Attached to Project: Arch Linux
Opened by Christoph Drexler (ChrDr) - Wednesday, 05 May 2010, 20:22 GMT
Last edited by Andrea Scarpino (BaSh) - Sunday, 04 July 2010, 23:36 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ronald van Haren (pressh)
Andrea Scarpino (BaSh)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

kfilereplace starts, I can enter search strings, replace strings, options etc.
When I try klick on "Simulate", the status bar shows "Replacing files (simulation)...", but on the right side, the status bar shows "Scanned files: 0".

When I klick on "Search" or "Replace", I get the same (non-)reaction. No files are changed at all.

When I start kfilereplace on the command line, the following messages are shown:

kfilereplace(9211) findLibraryInternal: plugins should not have a 'lib' prefix: "libkfilereplacepart.so"
kfilereplace(9211) kde4Factory: The library "/usr/lib/kde4/libkfilereplacepart.so" does not offer a qt_plugin_instance function.

Steps to reproduce:
1. Start kfilereplace
2. Enter any search/replace strings and options
3. Try starting the search
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Sunday, 04 July 2010, 23:36 GMT
Reason for closing:  Upstream
Comment by Ronald van Haren (pressh) - Thursday, 06 May 2010, 11:08 GMT
works for me after I've set the encoding (used ISO 8859-1). Please try that.
Comment by Christoph Drexler (ChrDr) - Thursday, 06 May 2010, 13:02 GMT
My files are encoded UTF-8, and this is the encoding which is preset in kfilereplace (at last here at my computer).

If I change the encoding manually to ISO 8859-1, it does not work, either.

I have also tried to toggle the "Include subfolders" option. If I turn it off, I get a dialog window, saying "Cannot open file </path/to/subfolder> for reading." for each of the subfolders, and in the status line I get "Scanned files: 14" (which is the number of subfolders). But still no regular files have been scanned.
Comment by Ronald van Haren (pressh) - Thursday, 06 May 2010, 13:22 GMT
I tried again, now using utf-8 encoding. Location defined in 'search/replace -> customize search & replace session' and filter as '*'.
Searching for some string gives me results.

Andrea, can you replicate the problem?
Comment by Andrea Scarpino (BaSh) - Thursday, 06 May 2010, 14:08 GMT
works for me (with filter '*') without specific any encoding
Comment by Christoph Drexler (ChrDr) - Saturday, 08 May 2010, 13:10 GMT
I tried the options described by Ronald van Haren.

If I use just one filter (e.g. '*' or '*.html') and if I just 'Search", it works for me, too.

But it still does not work if I either
* use the preset filter '*.htm;*.html;*.xml;*.xhtml;*.css;*.js;*.php' or
* try to 'Simulate' or 'Replace'.
Comment by Ronald van Haren (pressh) - Monday, 10 May 2010, 09:55 GMT
okay so it does not work when defining multiple filters, I can confirm that. I have to take a look at the code to see why this is happening, but you may also want to file an upstream bug report, I can't imaging this being a packaging bug.
Comment by Ronald van Haren (pressh) - Tuesday, 11 May 2010, 09:49 GMT
had a really quick look at the source. Multiple filters should be separated by ',' instead of ';', though there still seems to be a bug as doing that only the first filter (or directory when using multiple directories) is searched.
Comment by Christoph Drexler (ChrDr) - Tuesday, 11 May 2010, 15:43 GMT
I can confirm that entering multiple filters separated by ',' makes just the first filter work. Trying again to "Customize Search/Replace Session" shows just the first entered filter, too, all the other ones are vanished. The same is true for the "Search" and "Replace" strings, they are vanished every time I try to "Customize Search/Replace Session".

So at least searching with just one filter works now, but replacing (and simulating the replacement) does not work at all, so I thing the bug description should be "doesn't search multiple filters/directories and does not replace anything"

Since this is quite a fundamental lack of functionality, I thought that there would already be any corresponding bug report if it were an upstream bug. I could not find that bug in the reports, but several other bug reports that implicate that kfilereplace seems to work more or less for other users. But as your code inspection suggests that this might be an upstream bug, anyway, I am going to file an upstream bug report.
Comment by Christoph Drexler (ChrDr) - Tuesday, 11 May 2010, 15:55 GMT
upstream bug report filed, see https://bugs.kde.org/show_bug.cgi?id=237268
Comment by Ronald van Haren (pressh) - Tuesday, 11 May 2010, 16:33 GMT
[quote]
So at least searching with just one filter works now, but replacing (and simulating the replacement) does not work at all, so I thing the bug description should be "doesn't search multiple filters/directories and does not replace anything"[/quote]
works here if I enter it in the dialog as before, hit search later and then simulate or replace in the main window.

do you have some sort of current kde live cd around in which you can check the behavior or know one which boots from harddrive (don't have any spare cds left to try atm)?
Comment by Christoph Drexler (ChrDr) - Tuesday, 11 May 2010, 16:45 GMT
no live cd lying around here, but I have started a Fedora live cd download. will take some time, though.

I will report the results when I have succeeded in downloading, burning and trying the live cd.
Comment by Christoph Drexler (ChrDr) - Tuesday, 11 May 2010, 16:58 GMT
I always tried to replace 'a' by 'aaaa' (because I wanted to be able to reverse the replacement) - this still does not work.

But trying to replace 'a' by 'b' works.

Anyway, if I do not "Include subfolders", I still get a dialog window, saying "Cannot open file </path/to/subfolder> for reading." for each of the subfolders.
Comment by Ronald van Haren (pressh) - Tuesday, 11 May 2010, 17:08 GMT
can't replicate either. If I understand correctly the method below should include both things you try to do:

- created a directory with a test.html file (and a few others) with just some random stuff in it (among it blabla)
- created a subdirectory with the same content
- set directory permissons of subdirectory to 444, also tried with normal 755
- search for 'bla', replace by 'blab'
- with 444 permissions only 'blabla' in test.hml in main directory is replaced by 'blablab', with 755 permissions on subdirectory also test.html in subdirectory is replaced (if include subdirectory option is checked of course).

Loading...