summaryrefslogtreecommitdiff
path: root/gtk/gtkrecentchoosermenu.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkrecentchoosermenu.c')
-rw-r--r--gtk/gtkrecentchoosermenu.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c
index 0e04b86575..9ad1cb10b4 100644
--- a/gtk/gtkrecentchoosermenu.c
+++ b/gtk/gtkrecentchoosermenu.c
@@ -411,8 +411,15 @@ gtk_recent_chooser_menu_set_current_uri (GtkRecentChooser *chooser,
if (!info)
continue;
- if (0 == strcmp (uri, gtk_recent_info_get_uri (info)))
- found = TRUE;
+ if (strcmp (uri, gtk_recent_info_get_uri (info)) == 0)
+ {
+ gtk_menu_shell_activate_item (GTK_MENU_SHELL (menu),
+ menu_item,
+ TRUE);
+ found = TRUE;
+
+ break;
+ }
}
g_list_free (children);
@@ -423,14 +430,9 @@ gtk_recent_chooser_menu_set_current_uri (GtkRecentChooser *chooser,
GTK_RECENT_CHOOSER_ERROR_NOT_FOUND,
_("No recently used resource found with URI `%s'"),
uri);
- return FALSE;
- }
- else
- {
- gtk_menu_shell_activate_item (GTK_MENU_SHELL (menu), menu_item, TRUE);
-
- return TRUE;
}
+
+ return found;
}
static gchar *