aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2010-05-03 18:31:25 +0800
committerXan Lopez <xan@gnome.org>2010-05-03 19:40:33 +0800
commit6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b (patch)
tree41b783c3523cdd2eb13ba6f9d428c5f218c5e963 /embed
parentbaca12963da2829f2208fef44587d2f8780643dc (diff)
downloadgsoc2013-epiphany-6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b.tar
gsoc2013-epiphany-6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b.tar.gz
gsoc2013-epiphany-6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b.tar.bz2
gsoc2013-epiphany-6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b.tar.lz
gsoc2013-epiphany-6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b.tar.xz
gsoc2013-epiphany-6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b.tar.zst
gsoc2013-epiphany-6ef9fa4aa4d068482412e3cde4dbdaf8dadc925b.zip
Move homepage loading code to EphyWebView
Create a method to make the EphyWebView load the homepage set by the user. This is in preparation for creating a signal for this action, which other code in Epiphany will need.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-web-view.c31
-rw-r--r--embed/ephy-web-view.h2
2 files changed, 33 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 19498da67..c3fa53a89 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -3523,4 +3523,35 @@ ephy_web_view_save (EphyWebView *view, const char *uri)
ephy_web_view_save_sub_resources (view, uri, subresources);
}
+/**
+ * ephy_web_view_load_homepage:
+ * @view: an #EphyWebView
+ *
+ * Loads the homepage set by the user in @view.
+ *
+ * Returns: %TRUE if there was a homepage set to be loaded in the user
+ * preferences, %FALSE otherwise
+ **/
+gboolean
+ephy_web_view_load_homepage (EphyWebView *view)
+{
+ char *home;
+ gboolean is_empty;
+
+ home = eel_gconf_get_string (CONF_GENERAL_HOMEPAGE);
+
+ if (home == NULL || home[0] == '\0')
+ {
+ g_free (home);
+
+ home = g_strdup ("about:blank");
+ }
+
+ is_empty = ephy_embed_utils_url_is_empty (home);
+ ephy_web_view_load_url (view, home);
+
+ g_free (home);
+
+ return is_empty;
+}
diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h
index b3ffb538b..323a8564f 100644
--- a/embed/ephy-web-view.h
+++ b/embed/ephy-web-view.h
@@ -190,6 +190,8 @@ void ephy_web_view_popups_manager_reset (EphyWebView
void ephy_web_view_save (EphyWebView *view,
const char *uri);
+gboolean ephy_web_view_load_homepage (EphyWebView *view);
+
G_END_DECLS
#endif