[kupfer] thunar: Create AppLeaf with init_path= init call



commit 2229af86c9d4ae0c37cef54314f0c9d641929bfb
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Mar 12 18:28:39 2011 +0100

    thunar: Create AppLeaf with init_path= init call

 kupfer/plugin/thunar.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/plugin/thunar.py b/kupfer/plugin/thunar.py
index 894e06d..deb5f4a 100644
--- a/kupfer/plugin/thunar.py
+++ b/kupfer/plugin/thunar.py
@@ -14,7 +14,7 @@ import os
 import dbus
 import gio
 
-from kupfer.objects import Leaf, Action, Source
+from kupfer.objects import Leaf, Action, Source, InvalidDataError
 from kupfer.objects import FileLeaf, RunnableLeaf, SourceLeaf, AppLeaf
 from kupfer.obj.apps import AppLeafContentMixin
 from kupfer import config
@@ -160,9 +160,10 @@ class _SendToAppsSource (Source):
 				file_path = os.path.join(data_dir, filename)
 				if not os.path.isfile(file_path):
 					continue
-				item = gio.unix.desktop_app_info_new_from_filename(file_path)
-				if item:
-					yield AppLeaf(item)
+				try:
+					yield AppLeaf(init_path=file_path)
+				except InvalidDataError:
+					pass
 
 	def get_icon_name(self):
 		return "Thunar"



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