util: don't depend on the nautilus GSettings schema
Without the desktop, even Nautilus hardcodes "Home" in all places nowadays (except for the desktop itself). I think a run-time dependency on nautilus being installed (GSettings will abort if the schema is not found) is not worth it to keep compatibility with the desktop. (Also, nautilus itself could probably hardcode "Home" for the desktop as well and remove the preference). https://bugzilla.gnome.org/show_bug.cgi?id=659895
This commit is contained in:
parent
5d25716cee
commit
18d69d7032
@ -75,8 +75,6 @@ shell_util_get_file_display_name_if_mount (GFile *file)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define HOME_NAME_SCHEMA "org.gnome.nautilus.desktop"
|
||||
#define HOME_NAME_KEY "home-icon-name"
|
||||
static char *
|
||||
shell_util_get_file_display_for_common_files (GFile *file)
|
||||
{
|
||||
@ -85,26 +83,11 @@ shell_util_get_file_display_for_common_files (GFile *file)
|
||||
compare = g_file_new_for_path (g_get_home_dir ());
|
||||
if (g_file_equal (file, compare))
|
||||
{
|
||||
GSettings *settings;
|
||||
char *name;
|
||||
|
||||
g_object_unref (compare);
|
||||
|
||||
settings = g_settings_new (HOME_NAME_SCHEMA);
|
||||
name = g_settings_get_string (settings, HOME_NAME_KEY);
|
||||
g_object_unref (settings);
|
||||
|
||||
if (!(name && name[0]))
|
||||
{
|
||||
g_free (name);
|
||||
return g_strdup (_("Home Folder"));
|
||||
}
|
||||
else
|
||||
{
|
||||
return name;
|
||||
}
|
||||
/* Translators: this is the same string as the one found in
|
||||
* nautilus */
|
||||
return g_strdup (_("Home"));
|
||||
}
|
||||
g_object_unref (compare);
|
||||
|
||||
compare = g_file_new_for_path ("/");
|
||||
if (g_file_equal (file, compare))
|
||||
|
Loading…
Reference in New Issue
Block a user