[gnome-system-monitor] Blacklist a few executable names in gio app table



commit 3260ae253638205ca5037d7495e77f31dc1b4db2
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Thu Aug 22 15:44:04 2013 +0200

    Blacklist a few executable names in gio app table
    
    A few applications install .desktop files with an Exec= line like:
    
      Exec=sh -c "hexchat --existing --url %u" || exec hexchat
    
    which makes GIO believe there's an "Hexchat" app with executable "sh".
    This is problematic when we look for an icon to associate to any process
    sh, because GIO gives us the Hexchat icon in this case.
    
    Fix this by blacklisting "sh" (and "env" which seems to have the same
    problem) when building the GIO application table.

 src/prettytable.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/prettytable.cpp b/src/prettytable.cpp
index 213861b..a4207e4 100644
--- a/src/prettytable.cpp
+++ b/src/prettytable.cpp
@@ -139,7 +139,10 @@ void PrettyTable::init_gio_app_cache ()
   for (Glib::ListHandle<Glib::RefPtr<Gio::AppInfo> >::const_iterator it = apps.begin();
        it != apps.end(); ++it) {
     Glib::RefPtr<Gio::AppInfo> app = *it;
-    this->gio_apps[app->get_executable()] = app;
+    std::string executable = app->get_executable();
+    if (executable != "sh" &&
+        executable != "env")
+        this->gio_apps[executable] = app;
   }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]