[Xfce4-commits] <midori:master> Fix stale GtkNotebook-isms in browser and tab panel

Christian Dywan noreply at xfce.org
Sun Dec 2 20:24:02 CET 2012


Updating branch refs/heads/master
         to 3d9447bbdc76dcb8a4f6e25b33f804a69469c829 (commit)
       from 520b2282442174f3a637c597b982d0dce2591015 (commit)

commit 3d9447bbdc76dcb8a4f6e25b33f804a69469c829
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Dec 2 20:21:31 2012 +0100

    Fix stale GtkNotebook-isms in browser and tab panel

 extensions/tab-panel.c  |    7 +++----
 midori/midori-browser.c |   33 ++-------------------------------
 midori/midori-browser.h |    3 ---
 midori/midori.vapi      |    4 ++--
 tests/tab.vala          |    6 +++++-
 5 files changed, 12 insertions(+), 41 deletions(-)

diff --git a/extensions/tab-panel.c b/extensions/tab-panel.c
index ea138d3..c0cc143 100644
--- a/extensions/tab-panel.c
+++ b/extensions/tab-panel.c
@@ -39,12 +39,11 @@ tab_panel_browser_notify_tab_cb (MidoriBrowser* browser,
                                  GtkTreeView*   treeview);
 static void
 tab_panel_browser_move_tab_cb (MidoriBrowser* browser,
-                               GtkNotebook*   notebook,
+                               GtkWidget*     notebook,
                                gint           cur_pos,
                                gint           new_pos,
                                gpointer       user_data);
 
-
 static void
 tab_panel_view_notify_minimized_cb (GtkWidget*       view,
                                     GParamSpec*      pspec,
@@ -623,7 +622,7 @@ tab_panel_activate_cb (MidoriExtension* extension,
 
 static void
 tab_panel_browser_move_tab_cb (MidoriBrowser* browser,
-                               GtkNotebook*   notebook,
+                               GtkWidget*     notebook,
                                gint           cur_pos,
                                gint           new_pos,
                                gpointer       user_data)
@@ -632,7 +631,7 @@ tab_panel_browser_move_tab_cb (MidoriBrowser* browser,
     gint last_page;
     GtkTreeModel *model;
 
-    last_page = gtk_notebook_get_n_pages (notebook) - 1;
+    last_page = midori_browser_get_n_pages (browser) - 1;
     model = tab_panel_get_model_for_browser (browser);
 
     gtk_tree_model_iter_nth_child (model, &cur, NULL, cur_pos);
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index b88fb50..0bf4a06 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -2110,11 +2110,7 @@ midori_browser_class_init (MidoriBrowserClass* class)
                                      "notebook",
                                      "Notebook",
                                      "The notebook containing the views",
-                                     #ifdef HAVE_GRANITE
-                                     GRANITE_WIDGETS_TYPE_DYNAMIC_NOTEBOOK,
-                                     #else
-                                     GTK_TYPE_NOTEBOOK,
-                                     #endif
+                                     GTK_TYPE_CONTAINER,
                                      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
     g_object_class_install_property (gobject_class,
@@ -7959,38 +7955,13 @@ midori_browser_get_tabs (MidoriBrowser* browser)
 }
 
 /**
- * midori_browser_get_proxy_items:
- * @browser: a #MidoriBrowser
- *
- * Retrieves a proxy array representing the respective proxy items
- * of the present views that can be used for session management.
- *
- * The array is updated automatically.
- *
- * Note: Calling this function doesn't add a reference and the browser
- *       may release its reference at some point.
- *
- * Return value: the proxy #KatzeArray
- *
- * Since: 0.2.5
- **/
-KatzeArray*
-midori_browser_get_proxy_items (MidoriBrowser* browser)
-{
-    g_return_val_if_fail (MIDORI_IS_BROWSER (browser), NULL);
-
-    return browser->proxy_array;
-}
-
-/**
  * midori_browser_get_proxy_array:
  * @browser: a #MidoriBrowser
  *
  * Retrieves a proxy array representing the respective proxy items.
+ * The array is updated automatically.
  *
  * Return value: the proxy #KatzeArray
- *
- * Deprecated: 0.2.5: Use midori_browser_get_proxy_item instead.
  **/
 KatzeArray*
 midori_browser_get_proxy_array (MidoriBrowser* browser)
diff --git a/midori/midori-browser.h b/midori/midori-browser.h
index 5353714..849d1be 100644
--- a/midori/midori-browser.h
+++ b/midori/midori-browser.h
@@ -167,9 +167,6 @@ gint
 midori_browser_get_n_pages            (MidoriBrowser*     browser);
 
 KatzeArray*
-midori_browser_get_proxy_items        (MidoriBrowser*     browser);
-
-KatzeArray*
 midori_browser_get_proxy_array        (MidoriBrowser*     browser);
 
 MidoriBrowser*
diff --git a/midori/midori.vapi b/midori/midori.vapi
index 2d7bb01..8b63637 100644
--- a/midori/midori.vapi
+++ b/midori/midori.vapi
@@ -61,7 +61,7 @@ namespace Midori {
         public unowned Gtk.ActionGroup get_action_group ();
         public static unowned Browser get_for_widget (Gtk.Widget widget);
         public unowned string[] get_toolbar_actions ();
-        public Katze.Array proxy_items { get; }
+        public Katze.Array proxy_array { get; }
 
         [NoAccessorMethod]
         public Gtk.MenuBar menubar { owned get; }
@@ -96,8 +96,8 @@ namespace Midori {
         public signal Browser new_window (Browser? browser);
         [HasEmitter]
         public signal void add_tab (View tab);
-        [HasEmitter]
         public signal void remove_tab (View tab);
+        public void close_tab (View tab);
         public signal void switch_tab (View? old_view, View? new_view);
         [HasEmitter]
         public signal void activate_action (string name);
diff --git a/tests/tab.vala b/tests/tab.vala
index 90e0a08..a02864f 100644
--- a/tests/tab.vala
+++ b/tests/tab.vala
@@ -141,7 +141,6 @@ void tab_special () {
     assert (tab.can_view_source ());
     assert (!tab.special);
     assert (tab.can_save ());
-    tab.destroy ();
 
     /* Mimic browser: SourceView with no external editor */
     var source = new Midori.View.with_title (null, tab.settings);
@@ -162,6 +161,11 @@ void tab_special () {
     assert (source.special);
     assert (!source.can_save ());
     assert (!source.web_view.get_view_source_mode ());
+
+    browser.activate_action ("TabMoveForward");
+    browser.activate_action ("TabMoveBackward");
+    browser.activate_action ("TabDuplicate");
+    browser.activate_action ("TabCloseOther");
 }
 
 void tab_download_dialog () {


More information about the Xfce4-commits mailing list