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:
PAUL007 2021-06-22 17:30:57 +05:30 committed by Andreas Kling
parent 8a3c9d9851
commit 3d42297ecd
Notes: sideshowbarker 2024-07-18 11:38:57 +09:00

View file

@ -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; });