[Xfce4-commits] <midori:master> Remove obsolete MidoriLocationAction and panel boilerplate

Christian Dywan noreply at xfce.org
Wed Nov 9 22:08:07 CET 2011


Updating branch refs/heads/master
         to d9c4bb15c0d0add3add59adbc76b2bec5a3e7224 (commit)
       from c12d8f1f25358a0f8f2d64d7eb245d82002364dd (commit)

commit d9c4bb15c0d0add3add59adbc76b2bec5a3e7224
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Nov 9 21:54:17 2011 +0100

    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 e51838b..129a81f 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 336b9a8..d707539 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -5701,35 +5701,19 @@ midori_browser_new_history_item (MidoriBrowser* browser,
 }
 
 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)
 {
     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 b4039d8..36fe369 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
@@ -1617,27 +1609,6 @@ midori_location_action_set_secondary_icon (MidoriLocationAction* location_action
 }
 
 /**
- * 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
  * @hint: a security hint
diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c
index 8bf7e48..15d27b2 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 ad2de72..0aec2be 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 0678df8..712dc70 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 83d070b..d24577e 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);
-}


More information about the Xfce4-commits mailing list