desktop_entries: Reload .desktop on search #269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since pop-launcher has been demonized, the desktop_entries plugin isn't relaunched on every search anymore. In consequence, it is not providing up-to-date results when .desktop files have changed (e.g., on un-/installation of a new application) anymore.
Move the app.reload() call into the request loop to trigger a re-index. In a release-build this has been fine performance wise on an 8th Gen i5 laptop device.
Alternatives could include remembering the last time the index was built (initialised to UNIX_EPOCH before the loop) and only conditionally triggering a re-index after a hot-period of 10s since the last run. In our testing this didn't result in any noticeable difference.
NOTE: This has been tested against commit fca3b25 but builds against master too. However, master error'ed with unrelated issues regarding the parsing of CLI arguments.