From d9c4bb15c0d0add3add59adbc76b2bec5a3e7224 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 9 Nov 2011 21:54:17 +0100 Subject: [PATCH] Remove obsolete MidoriLocationAction and panel boilerplate --- midori/main.c | 18 +++++------------- midori/midori-browser.c | 16 ---------------- midori/midori-locationaction.c | 29 ----------------------------- panels/midori-bookmarks.c | 16 ---------------- panels/midori-extensions.c | 17 ----------------- panels/midori-history.c | 16 ---------------- panels/midori-transfers.c | 16 ---------------- 7 files changed, 5 insertions(+), 123 deletions(-) diff --git a/midori/main.c b/midori/main.c index e51838b1..129a81f1 100644 --- a/midori/main.c +++ b/midori/main.c @@ -730,13 +730,11 @@ midori_browser_show_preferences_cb (MidoriBrowser* browser, } g_object_unref (array); - scrolled = katze_scrolled_new (NULL, NULL); - addon = g_object_new (MIDORI_TYPE_EXTENSIONS, NULL); + scrolled = g_object_new (KATZE_TYPE_SCROLLED, "visible", TRUE, NULL); + addon = g_object_new (MIDORI_TYPE_EXTENSIONS, "app", app, NULL); children = gtk_container_get_children (GTK_CONTAINER (addon)); gtk_widget_reparent (g_list_nth_data (children, 0), scrolled); g_list_free (children); - g_object_set (addon, "app", app, NULL); - gtk_widget_show (scrolled); page = katze_preferences_add_category (preferences, _("Extensions"), STOCK_EXTENSIONS); gtk_box_pack_start (GTK_BOX (page), scrolled, TRUE, TRUE, 4); @@ -793,19 +791,13 @@ midori_app_add_browser_cb (MidoriApp* app, panel = katze_object_get_object (browser, "panel"); - /* Bookmarks */ - addon = g_object_new (MIDORI_TYPE_BOOKMARKS, "app", app, NULL); - gtk_widget_show (addon); + addon = g_object_new (MIDORI_TYPE_BOOKMARKS, "app", app, "visible", TRUE, NULL); midori_panel_append_page (MIDORI_PANEL (panel), MIDORI_VIEWABLE (addon)); - /* History */ - addon = g_object_new (MIDORI_TYPE_HISTORY, "app", app, NULL); - gtk_widget_show (addon); + addon = g_object_new (MIDORI_TYPE_HISTORY, "app", app, "visible", TRUE, NULL); midori_panel_append_page (MIDORI_PANEL (panel), MIDORI_VIEWABLE (addon)); - /* Transfers */ - addon = g_object_new (MIDORI_TYPE_TRANSFERS, "app", app, NULL); - gtk_widget_show (addon); + addon = g_object_new (MIDORI_TYPE_TRANSFERS, "app", app, "visible", TRUE, NULL); midori_panel_append_page (MIDORI_PANEL (panel), MIDORI_VIEWABLE (addon)); /* Extensions */ diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 336b9a82..d7075395 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -5700,14 +5700,6 @@ midori_browser_new_history_item (MidoriBrowser* browser, katze_array_remove_item (browser->history, item); } -static void -midori_browser_history_clear_cb (KatzeArray* history, - MidoriBrowser* browser) -{ - GtkAction* location_action = _action_by_name (browser, "Location"); - midori_location_action_clear (MIDORI_LOCATION_ACTION (location_action)); -} - static void midori_browser_set_history (MidoriBrowser* browser, KatzeArray* history) @@ -5715,21 +5707,13 @@ midori_browser_set_history (MidoriBrowser* browser, if (browser->history == history) return; - if (browser->history) - g_signal_handlers_disconnect_by_func (browser->history, - midori_browser_history_clear_cb, - browser); if (history) g_object_ref (history); katze_object_assign (browser->history, history); - midori_browser_history_clear_cb (history, browser); if (!history) return; - g_signal_connect (browser->history, "clear", - G_CALLBACK (midori_browser_history_clear_cb), browser); - g_object_set (_action_by_name (browser, "Location"), "history", browser->history, NULL); } diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index b4039d88..36fe369d 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -1530,14 +1530,6 @@ midori_location_action_set_icon_for_uri (MidoriLocationAction* location_action, #endif } -void -midori_location_action_set_title_for_uri (MidoriLocationAction* location_action, - const gchar* title, - const gchar* uri) -{ - /* Nothing to do */ -} - /** * midori_location_action_set_search_engines: * @location_action: a #MidoriLocationAction @@ -1616,27 +1608,6 @@ midori_location_action_set_secondary_icon (MidoriLocationAction* location_action #endif } -/** - * midori_location_action_delete_item_from_uri: - * @location_action: a #MidoriLocationAction - * @uri: a string - * - * Finds the item from the list matching @uri - * and removes it if it is the last instance. - **/ -void -midori_location_action_delete_item_from_uri (MidoriLocationAction* location_action, - const gchar* uri) -{ - /* Nothing to do */ -} - -void -midori_location_action_clear (MidoriLocationAction* location_action) -{ - g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action)); -} - /** * midori_location_action_set_security_hint: * @location_action: a #MidoriLocationAction diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index 8bf7e48b..15d27b2a 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -1028,19 +1028,3 @@ midori_bookmarks_finalize (GObject* object) g_object_unref (bookmarks->app); } -/** - * midori_bookmarks_new: - * - * Creates a new empty bookmarks. - * - * Return value: a new #MidoriBookmarks - * - * Since: 0.1.3 - **/ -GtkWidget* -midori_bookmarks_new (void) -{ - MidoriBookmarks* bookmarks = g_object_new (MIDORI_TYPE_BOOKMARKS, NULL); - - return GTK_WIDGET (bookmarks); -} diff --git a/panels/midori-extensions.c b/panels/midori-extensions.c index ad2de72f..0aec2be0 100644 --- a/panels/midori-extensions.c +++ b/panels/midori-extensions.c @@ -504,20 +504,3 @@ midori_extensions_finalize (GObject* object) g_object_unref (array); } -/** - * midori_extensions_new: - * - * Creates a new empty extensions. - * - * Return value: a new #MidoriExtensions - * - * Since: 0.1.2 - **/ -GtkWidget* -midori_extensions_new (void) -{ - MidoriExtensions* extensions = g_object_new (MIDORI_TYPE_EXTENSIONS, - NULL); - - return GTK_WIDGET (extensions); -} diff --git a/panels/midori-history.c b/panels/midori-history.c index 0678df82..712dc70c 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -1021,19 +1021,3 @@ midori_history_finalize (GObject* object) katze_assign (history->filter, NULL); } -/** - * midori_history_new: - * - * Creates a new empty history. - * - * Return value: a new #MidoriHistory - * - * Since: 0.1.3 - **/ -GtkWidget* -midori_history_new (void) -{ - MidoriHistory* history = g_object_new (MIDORI_TYPE_HISTORY, NULL); - - return GTK_WIDGET (history); -} diff --git a/panels/midori-transfers.c b/panels/midori-transfers.c index 83d070ba..d24577e0 100644 --- a/panels/midori-transfers.c +++ b/panels/midori-transfers.c @@ -561,19 +561,3 @@ midori_transfers_init (MidoriTransfers* transfers) G_CALLBACK (midori_transfers_hierarchy_changed_cb), NULL); } -/** - * midori_transfers_new: - * - * Creates a new empty transfers. - * - * Return value: a new #MidoriTransfers - * - * Since 0.1.5 - **/ -GtkWidget* -midori_transfers_new (void) -{ - MidoriTransfers* transfers = g_object_new (MIDORI_TYPE_TRANSFERS, NULL); - - return GTK_WIDGET (transfers); -}