pop-os / libcosmic

WIP library for COSMIC applications
https://pop-os.github.io/libcosmic/cosmic/
Mozilla Public License 2.0
427 stars 41 forks source link

fix: new matching algorithm for desktop entries #481

Closed wiiznokes closed 4 months ago

wiiznokes commented 4 months ago

This PR fix some issues in cosmic-app-list. The load_applications_for_app_ids function is totally rewritten. The match_entry function is used to determine if a DesktopEntry should match an id. This algo is used to match 2 strings, which gives good result. Some other metrics are used like the difference between the match length and the two string, and the entropy (does 2 matchs got similar result) .

With this new implementation, yt-music on brave and vscode works fine. I will make a PR in cosmic-applets soon to demonstrate and link to this