Skip to content

Conversation

VictoriousRaptor
Copy link
Contributor

@VictoriousRaptor VictoriousRaptor commented Nov 17, 2022

This is a optimization of #1479. PATH can be a subfolder of custom program sources. It makes unnecessary I/O when enabled PATH indexing because indexing for custom sources is recursive. And a custom source can be a subfolder of another.

And let file change watcher only watch files that can be indexed (exe, `lnk', ...).

Changes

  1. Refactored some code for readability.
  2. Detect if PATH is a subfolder of a custom source.
  3. Detect if a custom source is a subfolder of another.
  4. Only watch specific file extensions.
  5. Fix an issue where trying to open a .lnk files parent folder, it acutally opens its target's folder.

Tests

  • Programs in PATH can be indexed correctly.
  • Programs in custom sources can be indexed correctly.
  • Unnecessary IO is avoided.
  • Creating/Deleting a file with specifix extension triggers a reindex.

@VictoriousRaptor VictoriousRaptor marked this pull request as ready for review November 17, 2022 08:58
@VictoriousRaptor VictoriousRaptor self-assigned this Nov 17, 2022
open parent dir of .lnk instead of its target
Try to avoid situation like http matches https
</system:String>
<system:String x:Key="flowlauncher_plugin_program_protocol_tooltip">
Insert protocols of .url files you want to index. Protocols should be separated by ';'. (ex>ftp;netflix)
Insert protocols of .url files you want to index. Protocols should be separated by ';', and should end with "//". (ex>ftp://;mailto://)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't want really parse the URL. So try to tell users how to avoid situaions like http actually matches a URL starts with https.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not parse it? Uri.TryParse is not expensive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because for steam games their URL scheme is steam://app/ rather than steam:// so parsing the URL for protocol is not enough.

@jjw24 jjw24 added the bug Something isn't working label Nov 18, 2022
@jjw24 jjw24 changed the title [Program Plugin] Optimize program indexing performance [Dev][Program Plugin] Optimize program indexing performance Nov 18, 2022
@jjw24 jjw24 merged commit e7d57d9 into Flow-Launcher:dev Nov 18, 2022
@VictoriousRaptor VictoriousRaptor mentioned this pull request Nov 18, 2022
@VictoriousRaptor VictoriousRaptor added this to the 1.10.0 milestone Nov 18, 2022
@jjw24 jjw24 removed this from the 1.10.0 milestone Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Code Refactor

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants