diff options
-rw-r--r-- | libcaja-private/caja-desktop-link.c | 54 | ||||
-rw-r--r-- | libcaja-private/org.mate.caja.gschema.xml.in | 6 |
2 files changed, 45 insertions, 15 deletions
diff --git a/libcaja-private/caja-desktop-link.c b/libcaja-private/caja-desktop-link.c index 7ac505a3..dfb1a54d 100644 --- a/libcaja-private/caja-desktop-link.c +++ b/libcaja-private/caja-desktop-link.c @@ -91,6 +91,41 @@ mount_changed_callback (GMount *mount, CajaDesktopLink *link) } static void +caja_desktop_link_ensure_display_name (CajaDesktopLink *link) +{ + if (link->details->display_name[0] == 0) { + g_free (link->details->display_name); + + switch (link->details->type) + { + case CAJA_DESKTOP_LINK_HOME: + /* Note to translators: If it's hard to compose a good home + * icon name from the user name, you can use a string without + * an "%s" here, in which case the home icon name will not + * include the user's name, which should be fine. To avoid a + * warning, put "%.0s" somewhere in the string, which will + * match the user name string passed by the C code, but not + * put the user name in the final string. + */ + link->details->display_name = g_strdup_printf (_("%s's Home"), g_get_user_name ()); + break; + case CAJA_DESKTOP_LINK_COMPUTER: + link->details->display_name = g_strdup (_("Computer")); + break; + case CAJA_DESKTOP_LINK_NETWORK: + link->details->display_name = g_strdup (_("Network Servers")); + break; + case CAJA_DESKTOP_LINK_TRASH: + link->details->display_name = g_strdup (_("Trash")); + break; + default: + case CAJA_DESKTOP_LINK_MOUNT: + g_assert_not_reached(); + } + } +} + +static void trash_state_changed_callback (CajaTrashMonitor *trash_monitor, gboolean state, gpointer callback_data) @@ -121,19 +156,8 @@ home_name_changed (gpointer callback_data) link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_HOME_NAME); - if (link->details->display_name[0] == 0) { - g_free (link->details->display_name); - /* Note to translators: If it's hard to compose a good home - * icon name from the user name, you can use a string without - * an "%s" here, in which case the home icon name will not - * include the user's name, which should be fine. To avoid a - * warning, put "%.0s" somewhere in the string, which will - * match the user name string passed by the C code, but not - * put the user name in the final string. - */ - link->details->display_name = g_strdup_printf (_("%s's Home"), g_get_user_name ()); - } + caja_desktop_link_ensure_display_name (link); caja_desktop_link_changed (link); } @@ -148,6 +172,7 @@ computer_name_changed (gpointer callback_data) g_free (link->details->display_name); link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_COMPUTER_NAME); + caja_desktop_link_ensure_display_name (link); caja_desktop_link_changed (link); } @@ -161,6 +186,8 @@ trash_name_changed (gpointer callback_data) g_free (link->details->display_name); link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_TRASH_NAME); + + caja_desktop_link_ensure_display_name (link); caja_desktop_link_changed (link); } @@ -174,6 +201,8 @@ network_name_changed (gpointer callback_data) g_free (link->details->display_name); link->details->display_name = g_settings_get_string (caja_desktop_preferences, CAJA_PREFERENCES_DESKTOP_NETWORK_NAME); + + caja_desktop_link_ensure_display_name (link); caja_desktop_link_changed (link); } @@ -247,6 +276,7 @@ caja_desktop_link_new (CajaDesktopLinkType type) g_assert_not_reached(); } + caja_desktop_link_ensure_display_name (link); create_icon_file (link); return link; diff --git a/libcaja-private/org.mate.caja.gschema.xml.in b/libcaja-private/org.mate.caja.gschema.xml.in index 13f808a6..fc8fb5ca 100644 --- a/libcaja-private/org.mate.caja.gschema.xml.in +++ b/libcaja-private/org.mate.caja.gschema.xml.in @@ -368,7 +368,7 @@ <_description>If this is set to true, an icon linking to the Network Servers view will be put on the desktop.</_description> </key> <key name="computer-icon-name" type="s"> - <default l10n="messages" context="computer-icon-name">'Computer'</default> + <default>''</default> <_summary>Desktop computer icon name</_summary> <_description>This name can be set if you want a custom name for the computer icon on the desktop.</_description> </key> @@ -378,12 +378,12 @@ <_description>This name can be set if you want a custom name for the home icon on the desktop.</_description> </key> <key name="trash-icon-name" type="s"> - <default l10n="messages" context="trash-icon-name">'Trash'</default> + <default>''</default> <_summary>Desktop trash icon name</_summary> <_description>This name can be set if you want a custom name for the trash icon on the desktop.</_description> </key> <key name="network-icon-name" type="s"> - <default l10n="messages" context="network-icon-name">'Network Servers'</default> + <default>''</default> <_summary>Network servers icon name</_summary> <_description>This name can be set if you want a custom name for the network servers icon on the desktop.</_description> </key> |