Re: [Lazarus] Feedback requested: File Search, a visual file search utility

2019-09-27 Thread Anthony Walter via lazarus
Bart,

Thanks for suggesting TMaskList. I added it in and it works much better
than the normal FindFirst pattern matching. It also allowed me to remove
the duplicate checking.

Regarding TShellView, you might want to look at my Shell Control library.
It is explorer for Windows, as well as a few other controls including a
shell path with breadcrumb drop down menus, and a shell bubble type control
for listing common folders. The source code is Windows only, but it's now
available for free:

https://www.codebot.org/shell/
https://www.codebot.org/delphi/?doc=9613

and sources:

https://gitlab.com/sysrpl/codebot.shell

Feel free to modify the sources to work under Lazarus.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Feedback requested: File Search, a visual file search utility

2019-09-25 Thread Bart via lazarus
On Wed, Sep 25, 2019 at 7:51 PM Anthony Walter via lazarus
 wrote:

> Thanks. I'll look into TMaskList. I assume you mean this bit of code?
>
> https://github.com/alrieckert/lazarus/blob/master/components/lazutils/masks.pas

Yes, it's in the masks unit.

Bart
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Feedback requested: File Search, a visual file search utility

2019-09-25 Thread Denis Kozlov via lazarus

Hi Anthony,

It looks great!

If you were looking for new features, please consider the following 
features:


1. Show the snippets from the file where the content was found, with
   some context lines around the matches.
2. Allow specifying regular expressions for content search (optionally).

These are killer features that any file content search app must have in 
my opinion.


You can see an example implementation in AstroGrep (Windows only):
http://astrogrep.sourceforge.net/screenshots/

Denis


On 25/09/2019 06:32, Anthony Walter via lazarus wrote:
If anyone is interested I've posted another hopefully useful program 
along with the source.


https://www.getlazarus.org/apps/filesearch/

The File Search utility is a stand alone tool for Mac, Windows, and 
Linux to search for files using a variety of criteria including 
containing text, file size, and file dates. The full source code is 
available on github and it has no dependencies other than the LCL, so 
anyone should be able to compile with a default installation of Lazarus.


I believe the program is bug free and pretty much feature complete per 
my original idea. If anyone would like to leave a comment of make a 
suggestion I'd open to your ideas.


-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Feedback requested: File Search, a visual file search utility

2019-09-25 Thread Anthony Walter via lazarus
Thanks. I'll look into TMaskList. I assume you mean this bit of code?

https://github.com/alrieckert/lazarus/blob/master/components/lazutils/masks.pas

I am not sure how much this slows things down, and the checking if a file
has already been added only happen on per directory basis, meaning the list
is emptied with each folder and the search if already exists is reset to
zero each time search enters a new folder. I will look into this though.

Thank you for your feedback.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Feedback requested: File Search, a visual file search utility

2019-09-25 Thread Bart via lazarus
On Wed, Sep 25, 2019 at 7:38 PM Bart  wrote:

> An alternative would be to use a TMaskList and use it's MatchesMaks
> method (and search the folder with AllFilesMaks).

As you can see, my fingers struggle with the keyboard ;-)
Everywhere it says *maks, you should read *mask.

-- 
Bart
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Feedback requested: File Search, a visual file search utility

2019-09-25 Thread Bart via lazarus
On Wed, Sep 25, 2019 at 7:33 AM Anthony Walter via lazarus
 wrote:

> The File Search utility is a stand alone tool for Mac, Windows, and Linux to 
> search for files using a variety of criteria including containing text, file 
> size,
> and file dates.

First of all: NICE!

You asked foor feedback.

You search the entire folder for each pattern in a loop (e.g. 10
patterns, 10 times a FindFirst/FindNext loop)..
Then you see if a given match already is in the list (with IndexOf,
whic will be slow if you have lots of items).

An alternative would be to use a TMaskList and use it's MatchesMaks
method (and search the folder with AllFilesMaks).
This way you can be sure no double entries will be found.

If the count of patterns is 1, then an optimization could be to not
use a TMaskList but let the OS do the filtering with
FindFirst/FindNext.

Using a TMaskList offers you the possibility to let the user decide
wether the patterns are case-sensitive.
AFAICS, then as it is now, patterns are case-sensitive on *nix systems.
This makes finding e.g. all JPEG's a bit awkward on those platforms
(you would have to specify each and every possible mix of uppercase
and lowercase spelling of '*.jpg;*.jpeg').

I recently adapted TShellTreeView/TShellTreeView to do it like that.
(Previously it used a TAvlTree for this purpos, which is faster when
searching than a TStringList)


-- 
Bart
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Feedback requested: File Search, a visual file search utility

2019-09-24 Thread Anthony Walter via lazarus
If anyone is interested I've posted another hopefully useful program along
with the source.

https://www.getlazarus.org/apps/filesearch/

The File Search utility is a stand alone tool for Mac, Windows, and Linux
to search for files using a variety of criteria including containing text,
file size, and file dates. The full source code is available on github and
it has no dependencies other than the LCL, so anyone should be able to
compile with a default installation of Lazarus.

I believe the program is bug free and pretty much feature complete per my
original idea. If anyone would like to leave a comment of make a suggestion
I'd open to your ideas.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus