[epiphany] embed-shell: Fix dumb return types



commit 937160676e46600c532450007764100e017761a0
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Feb 19 12:23:09 2017 -0600

    embed-shell: Fix dumb return types

 embed/ephy-about-handler.c                 |    2 +-
 embed/ephy-embed-shell.c                   |   10 +++++-----
 embed/ephy-embed-shell.h                   |    7 +++++--
 embed/ephy-web-view.c                      |    2 +-
 src/ephy-encoding-dialog.c                 |    4 +---
 src/ephy-header-bar.c                      |    2 +-
 src/ephy-location-controller.c             |    2 +-
 src/ephy-shell.c                           |    3 +--
 src/prefs-dialog.c                         |    2 +-
 src/search-provider/ephy-search-provider.c |    2 +-
 tests/ephy-completion-model-test.c         |    4 ++--
 tests/ephy-encodings-test.c                |    2 +-
 tests/ephy-web-view-test.c                 |    2 +-
 13 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
index eec76b3..54b85be 100644
--- a/embed/ephy-about-handler.c
+++ b/embed/ephy-about-handler.c
@@ -535,7 +535,7 @@ ephy_about_handler_handle_html_overview (EphyAboutHandler       *handler,
   EphyHistoryService *history;
   EphyHistoryQuery *query;
 
-  history = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default 
()));
+  history = ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ());
   query = ephy_history_query_new_for_overview ();
   ephy_history_service_query_urls (history, query, NULL,
                                    (EphyHistoryJobCallback)history_service_query_urls_cb,
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 92d0615..5779c38 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -479,7 +479,7 @@ ephy_embed_shell_schedule_thumbnail_update (EphyEmbedShell *shell,
  *
  * Return value: (transfer none): the global #EphyHistoryService
  **/
-GObject *
+EphyHistoryService *
 ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
 {
   EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
@@ -517,7 +517,7 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
                       shell);
   }
 
-  return G_OBJECT (priv->global_history_service);
+  return priv->global_history_service;
 }
 
 static void
@@ -526,7 +526,7 @@ snapshot_saved_cb (EphySnapshotService *service,
                    gint64               mtime,
                    EphyEmbedShell      *shell)
 {
-  ephy_history_service_set_url_thumbnail_time (EPHY_HISTORY_SERVICE 
(ephy_embed_shell_get_global_history_service (shell)),
+  ephy_history_service_set_url_thumbnail_time (ephy_embed_shell_get_global_history_service (shell),
                                                url, mtime,
                                                NULL, NULL, NULL);
 }
@@ -537,7 +537,7 @@ snapshot_saved_cb (EphySnapshotService *service,
  *
  * Return value: (transfer none):
  **/
-GObject *
+EphyEncodings *
 ephy_embed_shell_get_encodings (EphyEmbedShell *shell)
 {
   EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
@@ -547,7 +547,7 @@ ephy_embed_shell_get_encodings (EphyEmbedShell *shell)
   if (priv->encodings == NULL)
     priv->encodings = ephy_encodings_new ();
 
-  return G_OBJECT (priv->encodings);
+  return priv->encodings;
 }
 
 void
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 969d666..8004002 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -22,7 +22,9 @@
 #pragma once
 
 #include <webkit2/webkit2.h>
+
 #include "ephy-downloads-manager.h"
+#include "ephy-encodings.h"
 #include "ephy-history-service.h"
 #include "ephy-permissions-manager.h"
 
@@ -52,8 +54,9 @@ struct _EphyEmbedShellClass
 
 EphyEmbedShell    *ephy_embed_shell_get_default                (void);
 WebKitWebContext  *ephy_embed_shell_get_web_context            (EphyEmbedShell   *shell);
-GObject           *ephy_embed_shell_get_global_history_service (EphyEmbedShell   *shell);
-GObject           *ephy_embed_shell_get_encodings              (EphyEmbedShell   *shell);
+EphyHistoryService
+                  *ephy_embed_shell_get_global_history_service (EphyEmbedShell   *shell);
+EphyEncodings     *ephy_embed_shell_get_encodings              (EphyEmbedShell   *shell);
 void               ephy_embed_shell_restored_window            (EphyEmbedShell   *shell);
 void               ephy_embed_shell_set_page_setup             (EphyEmbedShell   *shell,
                                                                 GtkPageSetup     *page_setup);
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index b3bf490..caca39e 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2419,7 +2419,7 @@ ephy_web_view_init (EphyWebView *web_view)
 
   web_view->file_monitor = ephy_file_monitor_new (web_view);
 
-  web_view->history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ()));
+  web_view->history_service = ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ());
   web_view->history_service_cancellable = g_cancellable_new ();
 
   g_signal_connect_object (web_view->history_service,
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index 0f76cbe..f3b7468 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -352,9 +352,7 @@ ephy_encoding_dialog_init (EphyEncodingDialog *dialog)
   dialog->update_embed_tag = FALSE;
   dialog->update_view_tag = FALSE;
 
-  dialog->encodings =
-    EPHY_ENCODINGS (ephy_embed_shell_get_encodings
-                      (EPHY_EMBED_SHELL (ephy_shell_get_default ())));
+  dialog->encodings = ephy_embed_shell_get_encodings (EPHY_EMBED_SHELL (ephy_shell_get_default ()));
 
   encodings = ephy_encodings_get_all (dialog->encodings);
 
diff --git a/src/ephy-header-bar.c b/src/ephy-header-bar.c
index e7928d7..9c5689b 100644
--- a/src/ephy-header-bar.c
+++ b/src/ephy-header-bar.c
@@ -827,7 +827,7 @@ ephy_header_bar_constructed (GObject *object)
   gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), header_bar->downloads_revealer);
   gtk_widget_show (header_bar->downloads_revealer);
 
-  history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ()));
+  history_service = ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ());
 
   g_signal_connect (history_service,
                     "cleared", G_CALLBACK (ephy_history_cleared_cb),
diff --git a/src/ephy-location-controller.c b/src/ephy-location-controller.c
index 958906f..49b603a 100644
--- a/src/ephy-location-controller.c
+++ b/src/ephy-location-controller.c
@@ -415,7 +415,7 @@ ephy_location_controller_constructed (GObject *object)
   if (!EPHY_IS_LOCATION_ENTRY (controller->title_widget))
     return;
 
-  history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ()));
+  history_service = ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ());
   bookmarks_manager = ephy_shell_get_bookmarks_manager (ephy_shell_get_default ());
   model = ephy_completion_model_new (history_service, bookmarks_manager);
   ephy_location_entry_set_completion (EPHY_LOCATION_ENTRY (controller->title_widget),
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index ba20ee8..18b1cd7 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -867,8 +867,7 @@ ephy_shell_get_history_dialog (EphyShell *shell)
   embed_shell = ephy_embed_shell_get_default ();
 
   if (shell->history_dialog == NULL) {
-    service = EPHY_HISTORY_SERVICE
-                (ephy_embed_shell_get_global_history_service (embed_shell));
+    service = ephy_embed_shell_get_global_history_service (embed_shell);
     shell->history_dialog = ephy_history_dialog_new (service);
     g_signal_connect (shell->history_dialog,
                       "destroy",
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 27b20fa..6c6df87 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1868,7 +1868,7 @@ setup_language_page (PrefsDialog *dialog)
                    "active",
                    G_SETTINGS_BIND_DEFAULT);
 
-  encodings = EPHY_ENCODINGS (ephy_embed_shell_get_encodings (EPHY_EMBED_SHELL (ephy_shell_get_default ())));
+  encodings = ephy_embed_shell_get_encodings (EPHY_EMBED_SHELL (ephy_shell_get_default ()));
 
   create_node_combo (dialog, encodings, "ISO-8859-1");
 
diff --git a/src/search-provider/ephy-search-provider.c b/src/search-provider/ephy-search-provider.c
index 57847d2..977fa7d 100644
--- a/src/search-provider/ephy-search-provider.c
+++ b/src/search-provider/ephy-search-provider.c
@@ -370,7 +370,7 @@ ephy_search_provider_init (EphySearchProvider *self)
 
   filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
   self->bookmarks_manager = ephy_bookmarks_manager_new ();
-  self->model = ephy_completion_model_new (EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service 
(shell)),
+  self->model = ephy_completion_model_new (ephy_embed_shell_get_global_history_service (shell),
                                            self->bookmarks_manager);
   g_free (filename);
 
diff --git a/tests/ephy-completion-model-test.c b/tests/ephy-completion-model-test.c
index dc3e8b3..869d16b 100644
--- a/tests/ephy-completion-model-test.c
+++ b/tests/ephy-completion-model-test.c
@@ -30,7 +30,7 @@ static void
 test_ephy_completion_model_create (void)
 {
   EphyCompletionModel *model;
-  model = ephy_completion_model_new (EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ())),
+  model = ephy_completion_model_new (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ()),
                                      ephy_shell_get_bookmarks_manager (ephy_shell_get_default ()));
   g_assert (model);
   g_object_unref (model);
@@ -56,7 +56,7 @@ test_ephy_completion_model_update_empty (void)
   EphyCompletionModel *model;
   GMainLoop *loop = NULL;
 
-  model = ephy_completion_model_new (EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ())),
+  model = ephy_completion_model_new (ephy_embed_shell_get_global_history_service 
(ephy_embed_shell_get_default ()),
                                      ephy_shell_get_bookmarks_manager (ephy_shell_get_default ()));
   g_assert (model);
 
diff --git a/tests/ephy-encodings-test.c b/tests/ephy-encodings-test.c
index 590102e..22fa039 100644
--- a/tests/ephy-encodings-test.c
+++ b/tests/ephy-encodings-test.c
@@ -56,7 +56,7 @@ test_ephy_encodings_get (void)
   EphyEncodings *encodings;
   GList *all, *p;
 
-  encodings = EPHY_ENCODINGS (ephy_embed_shell_get_encodings (embed_shell));
+  encodings = ephy_embed_shell_get_encodings (embed_shell);
   g_assert (encodings);
 
   all = ephy_encodings_get_all (encodings);
diff --git a/tests/ephy-web-view-test.c b/tests/ephy-web-view-test.c
index 794f202..eb3351f 100644
--- a/tests/ephy-web-view-test.c
+++ b/tests/ephy-web-view-test.c
@@ -421,7 +421,7 @@ test_ephy_web_view_error_pages_not_stored_in_history (void)
   loop = g_main_loop_new (NULL, FALSE);
   bad_url = "http://localhost:2984375932/";;
 
-  history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (embed_shell));
+  history_service = ephy_embed_shell_get_global_history_service (embed_shell);
   g_assert (history_service);
   g_signal_connect (history_service, "visit-url",
                     G_CALLBACK (visit_url_cb), NULL);


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