[epiphany] ephy-shell: return the proper types for EphySession and GNetworkMonitor



commit 370d8d7a79ee3b4270f67fe4664875b288a6f89a
Author: Xan Lopez <xan igalia com>
Date:   Thu Feb 7 21:00:06 2013 +0100

    ephy-shell: return the proper types for EphySession and GNetworkMonitor

 src/ephy-shell.c          |   14 +++++++-------
 src/ephy-shell.h          |   21 +++++++++++----------
 src/ephy-window.c         |    4 ++--
 tests/ephy-session-test.c |    8 ++++----
 4 files changed, 24 insertions(+), 23 deletions(-)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 5236f2a..81fd0d4 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -119,7 +119,7 @@ ephy_shell_startup_continue (EphyShell *shell)
   EphyShellStartupContext *ctx;
   EphySession *session;
 
-  session = EPHY_SESSION (ephy_shell_get_session (shell));
+  session = ephy_shell_get_session (shell);
   g_assert (session != NULL);
 
   ctx = shell->priv->startup_context;
@@ -267,7 +267,7 @@ ephy_shell_activate (GApplication *application)
     EphyShellStartupContext *ctx;
 
     ctx = shell->priv->startup_context;
-    ephy_session_resume (EPHY_SESSION (ephy_shell_get_session (shell)),
+    ephy_session_resume (ephy_shell_get_session (shell),
                          ctx->user_time, NULL, session_load_cb, shell);
   } else
     ephy_shell_startup_continue (shell);
@@ -919,7 +919,7 @@ ephy_shell_new_tab (EphyShell *shell,
  *
  * Return value: (transfer none): the current session.
  **/
-GObject *
+EphySession *
 ephy_shell_get_session (EphyShell *shell)
 {
   g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
@@ -927,7 +927,7 @@ ephy_shell_get_session (EphyShell *shell)
   if (shell->priv->session == NULL)
     shell->priv->session = g_object_new (EPHY_TYPE_SESSION, NULL);
 
-  return G_OBJECT (shell->priv->session);
+  return shell->priv->session;
 }
 
 /**
@@ -950,7 +950,7 @@ ephy_shell_get_bookmarks (EphyShell *shell)
  *
  * Return value: (transfer none):
  **/
-GObject *
+GNetworkMonitor *
 ephy_shell_get_net_monitor (EphyShell *shell)
 {
   EphyShellPrivate *priv = shell->priv;
@@ -958,7 +958,7 @@ ephy_shell_get_net_monitor (EphyShell *shell)
   if (priv->network_monitor == NULL)
     priv->network_monitor = g_network_monitor_get_default ();
 
-  return G_OBJECT (priv->network_monitor);
+  return priv->network_monitor;
 }
 
 /**
@@ -1141,7 +1141,7 @@ ephy_shell_close_all_windows (EphyShell *shell)
 
   g_return_val_if_fail (EPHY_IS_SHELL (shell), FALSE);
 
-  ephy_session_close (EPHY_SESSION (ephy_shell_get_session (shell)));
+  ephy_session_close (ephy_shell_get_session (shell));
 
   windows = shell->priv->windows;
   while (windows) {
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index 5d0ca9f..70ebad2 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -27,10 +27,11 @@
 #ifndef EPHY_SHELL_H
 #define EPHY_SHELL_H
 
-#include "ephy-embed-shell.h"
 #include "ephy-bookmarks.h"
-#include "ephy-window.h"
+#include "ephy-embed-shell.h"
 #include "ephy-embed.h"
+#include "ephy-session.h"
+#include "ephy-window.h"
 
 #ifdef HAVE_WEBKIT2
 #include <webkit2/webkit2.h>
@@ -158,21 +159,21 @@ EphyEmbed      *ephy_shell_new_tab_full                 (EphyShell *shell,
                                                          gboolean is_popup,
                                                          guint32 user_time);
 
-GObject        *ephy_shell_get_session                  (EphyShell *shell);
+EphySession     *ephy_shell_get_session                  (EphyShell *shell);
 
-GObject        *ephy_shell_get_net_monitor              (EphyShell *shell);
+GNetworkMonitor *ephy_shell_get_net_monitor              (EphyShell *shell);
 
-EphyBookmarks  *ephy_shell_get_bookmarks                (EphyShell *shell);
+EphyBookmarks   *ephy_shell_get_bookmarks                (EphyShell *shell);
 
-GtkWidget      *ephy_shell_get_bookmarks_editor         (EphyShell *shell);
+GtkWidget       *ephy_shell_get_bookmarks_editor         (EphyShell *shell);
 
-GtkWidget      *ephy_shell_get_history_window           (EphyShell *shell);
+GtkWidget       *ephy_shell_get_history_window           (EphyShell *shell);
 
-GObject        *ephy_shell_get_pdm_dialog               (EphyShell *shell);
+GObject         *ephy_shell_get_pdm_dialog               (EphyShell *shell);
 
-GObject        *ephy_shell_get_prefs_dialog             (EphyShell *shell);
+GObject         *ephy_shell_get_prefs_dialog             (EphyShell *shell);
 
-GList          *ephy_shell_get_windows                  (EphyShell *shell);
+GList           *ephy_shell_get_windows                  (EphyShell *shell);
 
 guint           ephy_shell_get_n_windows                (EphyShell *shell);
 
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 548df02..ea18359 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1697,7 +1697,7 @@ sync_network_status (EphyEmbedSingle *single,
 	GtkAction *action;
 	gboolean is_online;
 
-	GNetworkMonitor *monitor = G_NETWORK_MONITOR (ephy_shell_get_net_monitor (ephy_shell_get_default ()));
+	GNetworkMonitor *monitor = ephy_shell_get_net_monitor (ephy_shell_get_default ());
 	is_online = g_network_monitor_get_network_available (monitor);
 
 	action = gtk_action_group_get_action (priv->action_group,
@@ -4422,7 +4422,7 @@ ephy_window_close (EphyWindow *window)
 	/* If this is the last window, save its state in the session. */
 	if (ephy_shell_get_n_windows (ephy_shell_get_default ()) == 1)
 	{
-		ephy_session_close (EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ())));
+		ephy_session_close (ephy_shell_get_session (ephy_shell_get_default ()));
 	}
 
 	/* See bug #114689 */
diff --git a/tests/ephy-session-test.c b/tests/ephy-session-test.c
index 6fb2c6e..9d2d7c7 100644
--- a/tests/ephy-session-test.c
+++ b/tests/ephy-session-test.c
@@ -80,7 +80,7 @@ test_ephy_session_load (void)
     EphyEmbed *embed;
     EphyWebView *view;
 
-    session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
+    session = ephy_shell_get_session (ephy_shell_get_default ());
     g_assert (session);
 
     ret = load_session_from_string (session, session_data);
@@ -115,7 +115,7 @@ test_ephy_session_load_empty_session (void)
     EphyEmbed *embed;
     EphyWebView *view;
 
-    session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
+    session = ephy_shell_get_session (ephy_shell_get_default ());
     g_assert (session);
 
     ret = load_session_from_string (session, session_data_empty);
@@ -165,7 +165,7 @@ test_ephy_session_load_many_windows (void)
     EphyEmbed *embed;
     EphyWebView *view;
 
-    session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
+    session = ephy_shell_get_session (ephy_shell_get_default ());
     g_assert (session);
 
     ret = load_session_from_string (session, session_data_many_windows);
@@ -198,7 +198,7 @@ open_uris_after_loading_session (const char** uris, int final_num_windows)
     EphyWebView *view;
     guint32 user_time;
 
-    session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
+    session = ephy_shell_get_session (ephy_shell_get_default ());
     g_assert (session);
 
     user_time = gdk_x11_display_get_user_time (gdk_display_get_default ());


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]