Taskbar: Check if executable in .af exist in filesystem
This adds access X_OK check in discover_apps_and_categories() to see executable specified in .af files exist before registering them for start menu.
This commit is contained in:
parent
8a3c9d9851
commit
3d42297ecd
Notes:
sideshowbarker
2024-07-18 11:38:57 +09:00
Author: https://github.com/TURING-V2 🔰 Commit: https://github.com/SerenityOS/serenity/commit/3d42297ecdf Pull-request: https://github.com/SerenityOS/serenity/pull/8200 Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 2 deletions
|
@ -87,8 +87,10 @@ Vector<String> discover_apps_and_categories()
|
|||
{
|
||||
HashTable<String> seen_app_categories;
|
||||
Desktop::AppFile::for_each([&](auto af) {
|
||||
g_apps.append({ af->executable(), af->name(), af->category() });
|
||||
seen_app_categories.set(af->category());
|
||||
if (access(af->executable().characters(), X_OK) == 0) {
|
||||
g_apps.append({ af->executable(), af->name(), af->category() });
|
||||
seen_app_categories.set(af->category());
|
||||
}
|
||||
});
|
||||
quick_sort(g_apps, [](auto& a, auto& b) { return a.name < b.name; });
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue