[Xfce4-commits] <midori:master> Get rid of meaningless can functions
Christian Dywan
noreply at xfce.org
Wed Sep 5 01:58:01 CEST 2012
Updating branch refs/heads/master
to 646b41b256114ddef593d7ffe17dd59cfcd6baf9 (commit)
from e75348c4632d28352b9c14a5c2d01acf94179e62 (commit)
commit 646b41b256114ddef593d7ffe17dd59cfcd6baf9
Author: Christian Dywan <christian at twotoasts.de>
Date: Wed Sep 5 00:57:32 2012 +0200
Get rid of meaningless can functions
extensions/delayed-load.vala | 4 ++--
midori/midori-browser.c | 9 ---------
midori/midori-view.c | 13 -------------
midori/midori-view.h | 9 ---------
midori/midori.vapi | 2 --
5 files changed, 2 insertions(+), 35 deletions(-)
diff --git a/extensions/delayed-load.vala b/extensions/delayed-load.vala
index 6826170..895296e 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 4182e5a..0255b02 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 36065f3..1414c16 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 cf5cfb3..22d98e8 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 088390e..3e984b0 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; }
More information about the Xfce4-commits
mailing list