[gnome-shell/hotplug: 5/21] autorun: make sure we have an app before trying to start it
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/hotplug: 5/21] autorun: make sure we have an app before trying to start it
- Date: Mon, 27 Jun 2011 19:52:22 +0000 (UTC)
commit 681f53116696ffe2e97be35c03e9a8667fd955b8
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Jun 21 12:58:19 2011 -0400
autorun: make sure we have an app before trying to start it
js/ui/autorunManager.js | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js
index 1894421..66f07bb 100644
--- a/js/ui/autorunManager.js
+++ b/js/ui/autorunManager.js
@@ -311,18 +311,20 @@ AutorunResidentNotification.prototype = {
item.add(ejectButton, { x_align: St.Align.END });
+ // TODO: need to do something better here...
+ if (!contentTypes.length)
+ contentTypes.push('inode/directory');
+
// now connect signals
mountLayout.connect('button-press-event', Lang.bind(this, function(actor, event) {
// ignore clicks not coming from the left mouse button
if (event.get_button() != 1)
return false;
- // TODO: need to do something better here...
- if (!contentTypes.length)
- contentTypes.push('inode/directory');
-
let app = Gio.app_info_get_default_for_type(contentTypes[0], false);
- startAppForMount(app, mount);
+
+ if (app)
+ startAppForMount(app, mount);
return true;
}));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]