From: Christian Dywan Date: Tue, 4 Sep 2012 22:57:32 +0000 (+0200) Subject: Get rid of meaningless can functions X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=646b41b256114ddef593d7ffe17dd59cfcd6baf9;p=midori Get rid of meaningless can functions --- diff --git a/extensions/delayed-load.vala b/extensions/delayed-load.vala index 68261700..895296ee 100644 --- a/extensions/delayed-load.vala +++ b/extensions/delayed-load.vala @@ -141,7 +141,7 @@ namespace DelayedLoad { item.ref(); int64 delay = item.get_meta_integer ("delay"); - if (delay == -2 && view.can_reload ()) { + if (delay == -2 && view.progress < 1.0) { this.schedule_reload (browser, view); } } @@ -164,7 +164,7 @@ namespace DelayedLoad { if (this.timeout != 0) this.tasks.set (browser, new TabShaker (browser)); - if (view.can_reload ()) + if (view.progress < 1.0) this.schedule_reload (browser, view); return false; diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 4182e5a0..0255b023 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -329,7 +329,6 @@ _midori_browser_update_interface (MidoriBrowser* browser, _action_set_sensitive (browser, "AddSpeedDial", !midori_view_is_blank (view)); _action_set_sensitive (browser, "BookmarkAdd", !midori_view_is_blank (view)); _action_set_sensitive (browser, "SaveAs", midori_view_can_save (view)); - _action_set_sensitive (browser, "Print", midori_view_can_print (view)); _action_set_sensitive (browser, "ZoomIn", midori_view_can_zoom_in (view)); _action_set_sensitive (browser, "ZoomOut", midori_view_can_zoom_out (view)); _action_set_sensitive (browser, "ZoomNormal", @@ -338,14 +337,6 @@ _midori_browser_update_interface (MidoriBrowser* browser, midori_view_can_view_source (view)); _action_set_sensitive (browser, "SourceView", midori_view_can_view_source (view)); - _action_set_sensitive (browser, "Find", - midori_view_can_find (view)); - _action_set_sensitive (browser, "FindNext", - midori_view_can_find (view)); - _action_set_sensitive (browser, "FindPrevious", - midori_view_can_find (view)); - midori_findbar_set_can_find (MIDORI_FINDBAR (browser->find), - midori_view_can_find (view)); action = _action_by_name (browser, "NextForward"); if (midori_view_can_go_forward (view)) diff --git a/midori/midori-view.c b/midori/midori-view.c index 36065f35..1414c165 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -5571,19 +5571,6 @@ midori_view_save_source (MidoriView* view, return unique_filename; } -#define can_do(what) \ -gboolean \ -midori_view_can_##what (MidoriView* view) \ -{ \ - g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE); \ -\ - return view->web_view != NULL; \ -} - -can_do (reload) -can_do (print) -can_do (find) - /** * midori_view_reload: * @view: a #MidoriView diff --git a/midori/midori-view.h b/midori/midori-view.h index cf5cfb3b..22d98e84 100644 --- a/midori/midori-view.h +++ b/midori/midori-view.h @@ -183,9 +183,6 @@ void midori_view_set_zoom_level (MidoriView* view, gfloat zoom_level); -gboolean -midori_view_can_reload (MidoriView* view); - void midori_view_reload (MidoriView* view, gboolean from_cache); @@ -219,9 +216,6 @@ midori_view_get_previous_page (MidoriView* view); const gchar* midori_view_get_next_page (MidoriView* view); -gboolean -midori_view_can_print (MidoriView* view); - void midori_view_print (MidoriView* view); @@ -236,9 +230,6 @@ midori_view_save_source (MidoriView* view, const gchar* uri, const gchar* outfile); -gboolean -midori_view_can_find (MidoriView* view); - void midori_view_unmark_text_matches (MidoriView* view); diff --git a/midori/midori.vapi b/midori/midori.vapi index 088390e3..3e984b07 100644 --- a/midori/midori.vapi +++ b/midori/midori.vapi @@ -144,7 +144,6 @@ namespace Midori { public Gtk.Label get_proxy_tab_label (); public Katze.Item get_proxy_item (); public bool can_view_source (); - public bool can_find (); public void search_text (string text, bool case_sensitive, bool forward); public void mark_text_matches (string text, bool case_sensitive); public void set_highlight_text_matches (bool highlight); @@ -152,7 +151,6 @@ namespace Midori { public Gdk.Pixbuf get_snapshot (int width, int height); public unowned WebKit.WebView get_web_view (); public void populate_popup (Gtk.Menu menu, bool manual); - public bool can_reload (); public void reload (bool from_cache); public string uri { get; }