[gnome-tweak-tool] Dont crash when failing to load desktop files



commit ce0008d97a6bddb7db431e43db0f11e6aebec40e
Author: John Stowers <john stowers gmail com>
Date:   Thu Aug 22 19:42:25 2013 +0200

    Dont crash when failing to load desktop files

 gtweak/tweaks/tweak_group_startup.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_startup.py b/gtweak/tweaks/tweak_group_startup.py
index 39aeca9..20fb13d 100644
--- a/gtweak/tweaks/tweak_group_startup.py
+++ b/gtweak/tweaks/tweak_group_startup.py
@@ -143,7 +143,12 @@ class AutostartListBoxTweakGroup(ListBoxTweakGroup):
         self.asm = AutostartManager()
         files = self.asm.get_user_autostart_files()
         for f in files:
-            df = Gio.DesktopAppInfo.new_from_filename(f)
+            try:
+                df = Gio.DesktopAppInfo.new_from_filename(f)
+            except TypeError:
+                logging.warning("Error loading desktopfile: %s" % f)
+                continue
+
             sdf = _StartupTweak(df)
             sdf.btn.connect("clicked", self._on_remove_clicked, sdf, df)
             tweaks.append( sdf )


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