qubes-desktop-run: don't crash on Debian wheezy (glib < 2.36)

Gio.DesktopAppInfo.get_boolean was introduced in glib 2.36. Instead of
crashing simply do not support DBusActivatable there. There is no such
application in default Debian wheezy template anyway.
This commit is contained in:
Marek Marczykowski-Górecki 2015-08-28 02:02:19 +02:00
父節點 67357e051f
當前提交 0b7ade11b8
沒有發現已知的金鑰在資料庫的簽署中
GPG 金鑰 ID: 063938BA42CFA724

查看文件

@ -6,13 +6,14 @@ import dbus
def launch(desktop, *files): def launch(desktop, *files):
launcher = Gio.DesktopAppInfo.new_from_filename(desktop) launcher = Gio.DesktopAppInfo.new_from_filename(desktop)
activatable = launcher.get_boolean('DBusActivatable') if hasattr(launcher, 'get_boolean'):
if activatable: activatable = launcher.get_boolean('DBusActivatable')
bus = dbus.SessionBus() if activatable:
service_id = launcher.get_id() bus = dbus.SessionBus()
# cut the .desktop suffix service_id = launcher.get_id()
service_id = service_id[:-8] # cut the .desktop suffix
bus.start_service_by_name(service_id) service_id = service_id[:-8]
bus.start_service_by_name(service_id)
launcher.launch(files, None) launcher.launch(files, None)
if __name__ == "__main__": if __name__ == "__main__":