From b8380232894669a10e19acb10b3dce7c626e9ae5 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 31 Mar 2012 03:36:00 +0200 Subject: [PATCH] Deprecate redundant midori_findbar_find --- midori/midori-browser.c | 4 ++-- toolbars/midori-findbar.c | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 5061ec05..cb8c04d6 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2752,14 +2752,14 @@ static void _action_find_next_activate (GtkAction* action, MidoriBrowser* browser) { - midori_findbar_find (MIDORI_FINDBAR (browser->find), TRUE); + midori_findbar_find_text (MIDORI_FINDBAR (browser->find), NULL, TRUE); } static void _action_find_previous_activate (GtkAction* action, MidoriBrowser* browser) { - midori_findbar_find (MIDORI_FINDBAR (browser->find), FALSE); + midori_findbar_find_text (MIDORI_FINDBAR (browser->find), NULL, FALSE); } static void diff --git a/toolbars/midori-findbar.c b/toolbars/midori-findbar.c index 6ef47f21..cbee17b5 100644 --- a/toolbars/midori-findbar.c +++ b/toolbars/midori-findbar.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2008-2010 Christian Dywan + Copyright (C) 2008-2012 Christian Dywan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -97,7 +97,7 @@ midori_findbar_find_key_press_event_cb (MidoriFindbar* findbar, else if (event->keyval == GDK_KEY_Return && (event->state & GDK_SHIFT_MASK)) { - midori_findbar_find (findbar, FALSE); + midori_findbar_find_text (findbar, NULL, FALSE); return TRUE; } @@ -141,6 +141,9 @@ midori_findbar_find_text (MidoriFindbar* findbar, if (!(view = midori_browser_get_current_tab (browser))) return; + if (text == NULL) + text = gtk_entry_get_text (GTK_ENTRY (findbar->find_text)); + case_sensitive = midori_findbar_case_sensitive (findbar); midori_view_search_text (MIDORI_VIEW (view), text, case_sensitive, forward); } @@ -161,12 +164,20 @@ midori_findbar_get_text (MidoriFindbar* findbar) return gtk_entry_get_text (GTK_ENTRY (findbar->find_text)); } +/** + * midori_findbar_find: + * @findbar: #MidoriFindbar + * @forward: %TRUE to search forward + * + * Advance to the next match. + * + * Deprecated: 0.4.5: Use midori_findbar_find_text() instead. + **/ void midori_findbar_find (MidoriFindbar* findbar, gboolean forward) { - const gchar* text = gtk_entry_get_text (GTK_ENTRY (findbar->find_text)); - midori_findbar_find_text (findbar, text, forward); + midori_findbar_find_text (findbar, NULL, forward); } void @@ -195,14 +206,14 @@ static void midori_findbar_next_activate_cb (GtkWidget* entry, MidoriFindbar* findbar) { - midori_findbar_find (findbar, TRUE); + midori_findbar_find_text (findbar, NULL, TRUE); } static void midori_findbar_previous_clicked_cb (GtkWidget* entry, MidoriFindbar* findbar) { - midori_findbar_find (findbar, FALSE); + midori_findbar_find_text (findbar, NULL, FALSE); } static void