New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get filter to work in filescatalog #253

Closed
bege10 opened this Issue Oct 29, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@bege10

bege10 commented Oct 29, 2017

02:35:14.591 Keypirinha 2.16.3 (b9833d8) for x64
02:35:14.591 System: WinNT-x64 6.1.7601-ws-0x0100 SP1.0
02:35:14.591 Portable mode
02:35:14.591 Keyboard layout: 00010407
02:35:14.591 Monitor #1: Name[\.\DISPLAY1] Rect[0, 0, 1920, 1080] DpiScale[1.40] PRIMARY

To get rid of the many "uninstall" entries in the start menu I moved the "extra_paths" from apps.ini to "paths" in the filescatalog.ini and added a filter. Without the filter all files are found. As soon as I add a filter no files are found at all.

What is wrong with this entry?:

paths =
    F:\Einstellungen\KP Utilities\**\*.lnk
    F:\Einstellungen\QL\**\*
    F:\ProgramData\Microsoft\Windows\Start Menu\Programs\**\*.lnk
    F:\Users\bege\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\**\*.lnk
filters =
    - uninstall*.lnk
    - *uninstall.lnk

The console entry shows this:

** Profile "StartmenusAndTools":
    internal_name   "startmenusandtools"
    include_hidden  no
    include_dirs    no
    include_files   yes
    max_depth       -1
    trim_extensions ('.lnk')
    file_item_label "{clean_name}"
    file_item_desc  <none>
    dir_item_label  "{clean_name}"
    dir_item_desc   <none>
    callback        default_scan_callback
    paths           F:\Einstellungen\KP Utilities\**\*.lnk
                   F:\Einstellungen\QL\**\*
                   F:\ProgramData\Microsoft\Windows\Start Menu\Programs\**\*.lnk
                   F:\Users\bege\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\**\*.lnk
    filters         - *uninstall.lnk
                   - uninstall*.lnk
03:15:54.285 FilesCatalog.FilesCatalog: Cataloging 1 profile...
03:15:54.504 FilesCatalog.FilesCatalog: Profile StartmenusAndTools: found 0 items in 0.2 seconds
03:15:54.504 FilesCatalog.FilesCatalog: Total: 0 items found and cataloged in 0.2 seconds

without filters this

03:36:47.324 FilesCatalog.FilesCatalog: Activated profiles (1):
** Profile "StartmenusAndTools":
   internal_name   "startmenusandtools"
   include_hidden  no
   include_dirs    no
   include_files   yes
   max_depth       -1
   trim_extensions ('.lnk')
   file_item_label "{clean_name}"
   file_item_desc  <none>
   dir_item_label  "{clean_name}"
   dir_item_desc   <none>
   callback        default_scan_callback
   paths           F:\Einstellungen\KP Utilities\**\*.lnk
                   F:\Einstellungen\QL\**\*
                   F:\ProgramData\Microsoft\Windows\Start Menu\Programs\**\*.lnk
                   F:\Users\bege\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\**\*.lnk
   filters         <none>
03:36:47.324 FilesCatalog.FilesCatalog: Cataloging 1 profile...
03:36:47.512 FilesCatalog.FilesCatalog: Profile StartmenusAndTools: found 710 items in 0.2 seconds
03:36:47.527 FilesCatalog.FilesCatalog: Cataloged 710 items in 0.0 seconds
03:36:47.527 FilesCatalog.FilesCatalog: Total: 710 items found and cataloged in 0.2 seconds
@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Oct 29, 2017

Member

Try with this configuration:

filters =
    - *uninstall*.lnk
    + *

As stated in the inline documentation of filters, if this setting is empty the default behavior is to include everything that matches the include_ settings. Otherwise if at least one filter is specified and an item does not match any of the specified filters, then the default behavior is to exclude the item.

I will make that more clear in the docs.

Member

polyvertex commented Oct 29, 2017

Try with this configuration:

filters =
    - *uninstall*.lnk
    + *

As stated in the inline documentation of filters, if this setting is empty the default behavior is to include everything that matches the include_ settings. Otherwise if at least one filter is specified and an item does not match any of the specified filters, then the default behavior is to exclude the item.

I will make that more clear in the docs.

@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Oct 29, 2017

Member

Also, note that in the next release (after v2.16.3), the default behavior will be changed as follows, so you do not have to append the + * filter at the end:

  • if filters is empty, default is to include the item
  • if filters contains only negative filters, default is to include the item
  • otherwise, default is to exclude the item
Member

polyvertex commented Oct 29, 2017

Also, note that in the next release (after v2.16.3), the default behavior will be changed as follows, so you do not have to append the + * filter at the end:

  • if filters is empty, default is to include the item
  • if filters contains only negative filters, default is to include the item
  • otherwise, default is to exclude the item
@bege10

This comment has been minimized.

Show comment
Hide comment
@bege10

bege10 Oct 29, 2017

Thank you very much, the + * did it!
To exclude any "Uninstall XXX" and "XXX uninstall" but not to exclude the "Iobit Uninstaller.lnk" I had to put it this way:

filters =
    - uninstall*.lnk
    - *uninstall.lnk
    + *

bege10 commented Oct 29, 2017

Thank you very much, the + * did it!
To exclude any "Uninstall XXX" and "XXX uninstall" but not to exclude the "Iobit Uninstaller.lnk" I had to put it this way:

filters =
    - uninstall*.lnk
    - *uninstall.lnk
    + *
@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Oct 29, 2017

Member

In this case, here is a more explicit and efficient alternative:

filters =
    + Iobit Uninstaller.lnk
    - *uninstall*.lnk
    + *
Member

polyvertex commented Oct 29, 2017

In this case, here is a more explicit and efficient alternative:

filters =
    + Iobit Uninstaller.lnk
    - *uninstall*.lnk
    + *
@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Nov 3, 2017

Member

Aforementioned behavior is now available in v2.17

Member

polyvertex commented Nov 3, 2017

Aforementioned behavior is now available in v2.17

@polyvertex polyvertex closed this Nov 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment