Avoid gratitious use of g_strdup_printf().

2007-07-13  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkrecentmanager.c (get_uri_shortname_for_display): Avoid
        gratitious use of g_strdup_printf().

        * gtk/gtkrecentchooserdefault.c:
        * gtk/gtkrecentchoosermenu.c: Mark some strings for
        translation.  (#439480, Murray Cumming)



svn path=/trunk/; revision=18465
This commit is contained in:
Matthias Clasen 2007-07-13 16:34:05 +00:00 committed by Matthias Clasen
parent da989212f3
commit a6f92ce4b0
4 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,12 @@
2007-07-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrecentmanager.c (get_uri_shortname_for_display): Avoid
gratitious use of g_strdup_printf().
* gtk/gtkrecentchooserdefault.c:
* gtk/gtkrecentchoosermenu.c: Mark some strings for
translation. (#439480, Murray Cumming)
2007-07-13 Kristian Rietveld <kris@imendio.com>
#408327, improve tooltip positioning.

View File

@ -1272,7 +1272,7 @@ gtk_recent_chooser_default_add_filter (GtkRecentChooser *chooser,
/* display new filter */
name = gtk_recent_filter_get_name (filter);
if (!name)
name = "Untitled filter";
name = _("Untitled filter");
gtk_combo_box_append_text (GTK_COMBO_BOX (impl->filter_combo), name);

View File

@ -795,9 +795,21 @@ gtk_recent_chooser_menu_create_item (GtkRecentChooserMenu *menu,
/* avoid clashing mnemonics */
if (count <= 10)
text = g_strdup_printf ("_%d. %s", count, escaped);
/* This is the label format that is used for the first 10 items
* in a recent files menu. The %d is the number of the item,
* the %s is the name of the item. Please keep the _ in front
* of the number to give these menu items a mnemonic.
*
* Don't include the prefix "recent menu label|" in the translation.
*/
text = g_strdup_printf (Q_("recent menu label|_%d. %s"), count, escaped);
else
text = g_strdup_printf ("%d. %s", count, escaped);
/* This is the format that is used for items in a recent files menu.
* The %d is the number of the item, the %s is the name of the item.
*
* Don't include the prefix "recent menu label|" in the translation.
*/
text = g_strdup_printf (Q_("recent menu label|%d. %s"), count, escaped);
item = gtk_image_menu_item_new_with_mnemonic (text);

View File

@ -2136,7 +2136,7 @@ get_uri_shortname_for_display (const gchar *uri)
rest = get_method_string (uri, &method);
local_file = g_filename_display_basename (rest);
name = g_strdup_printf ("%s: %s", method, local_file);
name = g_strconcat (method, ": ", local_file, NULL);
g_free (local_file);
g_free (method);