diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2016-10-23 09:20:18 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2016-10-23 09:21:51 -0500 |
commit | fc05345d0d7acde7bb7208159bca39783937e50e (patch) | |
tree | 07eb1d7a2358447200e12cfc58820dfd46c670c6 /lib/widgets | |
parent | b4dca2ea83d153cbdd9f2eea9e842e0744715624 (diff) | |
download | epiphany-fc05345d0d7acde7bb7208159bca39783937e50e.tar.gz |
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
Diffstat (limited to 'lib/widgets')
-rw-r--r-- | 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 d17680cb1..02d994d0d 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -663,12 +663,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", |