[epiphany/gnome-3-22] location-entry: Crash nicer if paste menuitem can't be found
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-22] location-entry: Crash nicer if paste menuitem can't be found
- Date: Mon, 28 Nov 2016 19:37:45 +0000 (UTC)
commit dc7a399b32b87d683bc5dcd162cef79859ec4ad3
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Oct 23 09:20:18 2016 -0500
location-entry: Crash nicer if paste menuitem can't be found
This is really unfortunate design, but I don't see any better way to
implement the code, so we'll have to crash if the translation is wrong.
Let's give a nice error message at least, and add a warning for the
translators, since this is quite a trap otherwise.
https://bugzilla.gnome.org/show_bug.cgi?id=772994
lib/widgets/ephy-location-entry.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 5ef8eb2..fdf5f89 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -649,12 +649,16 @@ entry_populate_popup_cb (GtkEntry *entry,
/* Search for the Paste menu item and insert right after it. */
children = gtk_container_get_children (GTK_CONTAINER (menu));
for (item = children, pos = 0; item != NULL; item = item->next, pos++) {
+ /* Translators: Location entry context menu item, must EXACTLY match GtkEntry's translation. */
if (g_strcmp0 (gtk_menu_item_get_label (item->data), _("_Paste")) == 0) {
paste_menuitem = item->data;
break;
}
}
+ if (!paste_menuitem)
+ g_error ("Broken translation, see bug #772994");
+
g_signal_connect (paste_and_go_menuitem, "activate",
G_CALLBACK (entry_paste_and_go_activate_cb), lentry);
lentry->paste_binding = g_object_bind_property (paste_menuitem, "sensitive",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]