diff options
author | António Fernandes <antoniof@gnome.org> | 2018-07-26 15:34:31 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano1618@gmail.com> | 2018-07-26 17:26:25 +0000 |
commit | 9ccec443a610505646bad362c24c2c923b29b884 (patch) | |
tree | 94d8721c5aa9e3acc9b66cf3da0c7fbd737c9da3 | |
parent | e9ddcea8b487dc708cd1d537bb01c57e4757cb1f (diff) | |
download | nautilus-9ccec443a610505646bad362c24c2c923b29b884.tar.gz |
pathbar: Show label for administrator root
Similar problem to the previous commit.
Ideally, we should simply call it "Computer", since it is the same
location. But we currently lack an effective visual clue that the
admin: backend is in use.
For that reason, label it "Administrator root" istead.
-rw-r--r-- | src/nautilus-pathbar.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c index fe87b7e80..81c19fe4d 100644 --- a/src/nautilus-pathbar.c +++ b/src/nautilus-pathbar.c @@ -46,6 +46,7 @@ typedef enum NORMAL_BUTTON, OTHER_LOCATIONS_BUTTON, ROOT_BUTTON, + ADMIN_ROOT_BUTTON, HOME_BUTTON, STARRED_BUTTON, RECENT_BUTTON, @@ -312,6 +313,10 @@ get_dir_name (ButtonData *button_data) { return _("Computer"); } + case ADMIN_ROOT_BUTTON: + { + return _("Administrator Root"); + } case HOME_BUTTON: { @@ -1286,6 +1291,7 @@ get_gicon (ButtonData *button_data) switch (button_data->type) { case ROOT_BUTTON: + case ADMIN_ROOT_BUTTON: { return g_themed_icon_new (NAUTILUS_ICON_FILESYSTEM); } @@ -1390,10 +1396,8 @@ setup_button_type (ButtonData *button_data, NautilusPathBar *self, GFile *location) { - GMount *mount; - gchar *uri; - - uri = g_file_get_uri (location); + g_autoptr (GMount) mount = NULL; + g_autofree gchar *uri = NULL; if (nautilus_is_root_directory (location)) { @@ -1419,20 +1423,21 @@ setup_button_type (ButtonData *button_data, button_data->dir_name = g_mount_get_name (mount); button_data->type = MOUNT_BUTTON; button_data->is_root = TRUE; - - g_object_unref (mount); } else if (nautilus_is_other_locations_directory (location)) { button_data->type = OTHER_LOCATIONS_BUTTON; button_data->is_root = TRUE; } + else if (strcmp ((uri = g_file_get_uri (location)), "admin:///") == 0) + { + button_data->type = ADMIN_ROOT_BUTTON; + button_data->is_root = TRUE; + } else { button_data->type = NORMAL_BUTTON; } - - g_free (uri); } static void @@ -1598,6 +1603,7 @@ make_button_data (NautilusPathBar *self, switch (button_data->type) { case ROOT_BUTTON: + case ADMIN_ROOT_BUTTON: case HOME_BUTTON: case MOUNT_BUTTON: case RECENT_BUTTON: |