From ff9509b901a2984d109b7504b4d190d81dc56b6f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 16 Sep 2012 14:24:25 -0300 Subject: [PATCH] autorunManager: Don't scan the filesystem if autorun is disabled Content-Type scanning can be expensive, and the user disabled autorun, so... https://bugzilla.gnome.org/show_bug.cgi?id=684093 --- js/ui/components/autorunManager.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js index 942576ad3..495063e38 100644 --- a/js/ui/components/autorunManager.js +++ b/js/ui/components/autorunManager.js @@ -83,13 +83,20 @@ const ContentTypeDiscoverer = new Lang.Class({ _init: function(callback) { this._callback = callback; + this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA }); }, guessContentTypes: function(mount) { - // guess mount's content types using GIO - mount.guess_content_type(false, null, - Lang.bind(this, - this._onContentTypeGuessed)); + let autorunEnabled = !this._settings.get_boolean(SETTING_DISABLE_AUTORUN); + + if (autorunEnabled) { + // guess mount's content types using GIO + mount.guess_content_type(false, null, + Lang.bind(this, + this._onContentTypeGuessed)); + } else { + this._emitCallback(mount, []); + } }, _onContentTypeGuessed: function(mount, res) {