aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-shell.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-12-30 05:05:09 +0800
committerChristian Persch <chpe@src.gnome.org>2003-12-30 05:05:09 +0800
commitc76b79acb1dd84aec4b91bae8841099699a38139 (patch)
tree2b0b28700be1db98ad314b12e00b4d76d6885fee /embed/ephy-embed-shell.c
parent6ca9d693750a2b0807670b0072ed5d162e12fea0 (diff)
downloadgsoc2013-epiphany-c76b79acb1dd84aec4b91bae8841099699a38139.tar
gsoc2013-epiphany-c76b79acb1dd84aec4b91bae8841099699a38139.tar.gz
gsoc2013-epiphany-c76b79acb1dd84aec4b91bae8841099699a38139.tar.bz2
gsoc2013-epiphany-c76b79acb1dd84aec4b91bae8841099699a38139.tar.lz
gsoc2013-epiphany-c76b79acb1dd84aec4b91bae8841099699a38139.tar.xz
gsoc2013-epiphany-c76b79acb1dd84aec4b91bae8841099699a38139.tar.zst
gsoc2013-epiphany-c76b79acb1dd84aec4b91bae8841099699a38139.zip
Unified return type of ephy_embed_shell_get_X to be GObject *. Fixed all
2003-12-29 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed-shell.c: (ephy_embed_shell_get_favicon_cache), (ephy_embed_shell_get_global_history), (ephy_embed_shell_get_downloader_view), (ephy_embed_shell_get_embed_single), (ephy_embed_shell_get_encodings), (ephy_embed_shell_check_mime), (ephy_embed_shell_class_init): * embed/ephy-embed-shell.h: * embed/mozilla/ContentHandler.cpp: * embed/mozilla/EphyHeaderSniffer.cpp: * embed/mozilla/GlobalHistory.cpp: * embed/mozilla/mozilla-notifiers.cpp: * src/bookmarks/ephy-bookmarks.c: (compute_lower_fav), (ephy_setup_history_notifiers): * src/ephy-completion-model.c: (ephy_completion_model_init): * src/ephy-shell.c: (ephy_shell_get_history_window): * src/ephy-tab.c: (ephy_tab_set_icon_address), (ephy_tab_address_cb), (ephy_tab_zoom_changed_cb): * src/ephy-toolbars-model.c: (impl_get_item_id): * src/prefs-dialog.c: (setup_font_combo), (prefs_clear_cache_button_clicked_cb): Unified return type of ephy_embed_shell_get_X to be GObject *. Fixed all callers.
Diffstat (limited to 'embed/ephy-embed-shell.c')
-rw-r--r--embed/ephy-embed-shell.c65
1 files changed, 30 insertions, 35 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 364eab5e6..003ea9425 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -26,6 +26,7 @@
#include "ephy-embed-factory.h"
#include "ephy-marshal.h"
#include "ephy-file-helpers.h"
+#include "ephy-history.h"
#include "ephy-favicon-cache.h"
#include "mozilla-embed-single.h"
#include "downloader-view.h"
@@ -140,6 +141,8 @@ ephy_embed_shell_finalize (GObject *object)
GObject *
ephy_embed_shell_get_favicon_cache (EphyEmbedShell *shell)
{
+ g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
+
if (shell->priv->favicon_cache == NULL)
{
shell->priv->favicon_cache = ephy_favicon_cache_new ();
@@ -148,48 +151,25 @@ ephy_embed_shell_get_favicon_cache (EphyEmbedShell *shell)
return G_OBJECT (shell->priv->favicon_cache);
}
-EphyHistory *
-ephy_embed_shell_get_global_history (EphyEmbedShell *shell)
-{
- EphyEmbedShellClass *klass = EPHY_EMBED_SHELL_GET_CLASS (shell);
- return klass->get_global_history (shell);
-}
-
GObject *
-ephy_embed_shell_get_downloader_view (EphyEmbedShell *shell)
-{
- EphyEmbedShellClass *klass = EPHY_EMBED_SHELL_GET_CLASS (shell);
- return klass->get_downloader_view (shell);
-}
-
-EphyEmbedSingle *
-ephy_embed_shell_get_embed_single (EphyEmbedShell *shell)
+ephy_embed_shell_get_global_history (EphyEmbedShell *shell)
{
+ g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
- if (!shell->priv->embed_single)
- {
- shell->priv->embed_single = EPHY_EMBED_SINGLE
- (ephy_embed_factory_new_object ("EphyEmbedSingle"));
- }
-
- return shell->priv->embed_single;
-}
-
-static EphyHistory *
-impl_get_global_history (EphyEmbedShell *shell)
-{
- if (!shell->priv->global_history)
+ if (shell->priv->global_history == NULL)
{
shell->priv->global_history = ephy_history_new ();
}
- return shell->priv->global_history;
+ return G_OBJECT (shell->priv->global_history);
}
-static GObject *
-impl_get_downloader_view (EphyEmbedShell *shell)
+GObject *
+ephy_embed_shell_get_downloader_view (EphyEmbedShell *shell)
{
- if (!shell->priv->downloader_view)
+ g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
+
+ if (shell->priv->downloader_view == NULL)
{
shell->priv->downloader_view = downloader_view_new ();
g_object_add_weak_pointer
@@ -201,8 +181,24 @@ impl_get_downloader_view (EphyEmbedShell *shell)
}
GObject *
+ephy_embed_shell_get_embed_single (EphyEmbedShell *shell)
+{
+ g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
+
+ if (shell->priv->embed_single == NULL)
+ {
+ shell->priv->embed_single = EPHY_EMBED_SINGLE
+ (ephy_embed_factory_new_object ("EphyEmbedSingle"));
+ }
+
+ return G_OBJECT (shell->priv->embed_single);
+}
+
+GObject *
ephy_embed_shell_get_encodings (EphyEmbedShell *shell)
{
+ g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
+
if (shell->priv->encodings == NULL)
{
shell->priv->encodings = ephy_encodings_new ();
@@ -271,6 +267,8 @@ ephy_embed_shell_check_mime (EphyEmbedShell *shell, const char *mime_type)
EphyMimePermission permission;
gpointer tmp;
+ g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), EPHY_MIME_PERMISSION_UNKNOWN);
+
if (shell->priv->mime_table == NULL)
{
shell->priv->mime_table = g_hash_table_new_full
@@ -316,8 +314,5 @@ ephy_embed_shell_class_init (EphyEmbedShellClass *klass)
object_class->finalize = ephy_embed_shell_finalize;
- klass->get_downloader_view = impl_get_downloader_view;
- klass->get_global_history = impl_get_global_history;
-
g_type_class_add_private (object_class, sizeof (EphyEmbedShellPrivate));
}