Get rid of meaningless can functions

This commit is contained in:
Christian Dywan 2012-09-05 00:57:32 +02:00
parent e75348c463
commit 646b41b256
5 changed files with 2 additions and 35 deletions

View file

@ -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;

View file

@ -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))

View file

@ -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

View file

@ -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);

View file

@ -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; }