Pārlūkot izejas kodu

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.

PAUL007 4 gadi atpakaļ
vecāks
revīzija
3d42297ecd
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4 2
      Userland/Services/Taskbar/main.cpp

+ 4 - 2
Userland/Services/Taskbar/main.cpp

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