[gnome-shell] places: Do not use nautilus' 'desktop-is-home-dir' setting
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] places: Do not use nautilus' 'desktop-is-home-dir' setting
- Date: Mon, 17 Jan 2011 20:05:38 +0000 (UTC)
commit ad52d783bda46c408bf37c87026a94b88086a1d9
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jan 17 20:52:26 2011 +0100
places: Do not use nautilus' 'desktop-is-home-dir' setting
g_settings_schema_new() aborts if the requested schema is not found,
so the previous approach of handling the case of unstable nautilus
not being installed did not work.
Instead, remove the use of the setting altogether - the original intent
was to not have separate items for Desktop and Home in the places
section if the nautilus key was set. As the section has been removed
anyway, the impact of always adding the desktop folder is minimal
(e.g. searching for "desktop" will match the desktop folder even
if it's set to the home folder).
js/ui/placeDisplay.js | 41 +----------------------------------------
1 files changed, 1 insertions(+), 40 deletions(-)
---
diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js
index 4bbdb06..b8745b2 100644
--- a/js/ui/placeDisplay.js
+++ b/js/ui/placeDisplay.js
@@ -15,9 +15,6 @@ const Main = imports.ui.main;
const Search = imports.ui.search;
const Util = imports.misc.util;
-const NAUTILUS_PREFS_SCHEMA = 'org.gnome.nautilus.preferences';
-const DESKTOP_IS_HOME_KEY = 'desktop-is-home-dir';
-
/**
* Represents a place object, which is most normally a bookmark entry,
* a mount/volume, or a special place like the Home Folder, Computer, and Network.
@@ -125,25 +122,6 @@ PlacesManager.prototype = {
this._mounts = [];
this._bookmarks = [];
- this._settings = null;
- this._isDesktopHome = false;
-
- // The GNOME3 version of nautilus has been ported to GSettings; we
- // don't require it though, so for now we'll have to deal with the
- // case of GNOME3 nautilus not being installed.
- try {
- this._settings = new Gio.Settings({ schema: NAUTILUS_PREFS_SCHEMA });
- } catch (e) {
- log('Failed to get settings from Nautilus. Places may not work as expected');
- }
-
- if (this._settings != null) {
- this._isDesktopHome = this._settings.get_boolean(DESKTOP_IS_HOME_KEY);
- this._settings.connect('changed::' + DESKTOP_IS_HOME_KEY,
- Lang.bind(this,
- this._updateDesktopMenuVisibility));
- }
-
let homeFile = Gio.file_new_for_path (GLib.get_home_dir());
let homeUri = homeFile.get_uri();
let homeLabel = Shell.util_get_label_for_uri (homeUri);
@@ -201,10 +179,7 @@ PlacesManager.prototype = {
}
this._defaultPlaces.push(this._home);
-
- this._desktopMenuIndex = this._defaultPlaces.length;
- if (!this._isDesktopHome)
- this._defaultPlaces.push(this._desktopMenu);
+ this._defaultPlaces.push(this._desktopMenu);
if (this._network)
this._defaultPlaces.push(this._network);
@@ -350,20 +325,6 @@ PlacesManager.prototype = {
this.emit('places-updated');
},
- _updateDesktopMenuVisibility: function() {
- this._isDesktopHome = this._settings.get_boolean(DESKTOP_IS_HOME_KEY);
-
- if (this._isDesktopHome)
- this._removeById(this._defaultPlaces, 'special:desktop');
- else
- this._defaultPlaces.splice(this._desktopMenuIndex, 0,
- this._desktopMenu);
-
- /* See comment in _updateDevices for explanation why there are two signals. */
- this.emit('defaults-updated');
- this.emit('places-updated');
- },
-
_addMount: function(mount) {
let devItem = new PlaceDeviceInfo(mount);
this._mounts.push(devItem);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]