]> spindle.queued.net Git - midori/commitdiff
Adjust completion test after modifying the location entry
authorChristian Dywan <christian@twotoasts.de>
Sun, 17 May 2009 14:55:02 +0000 (16:55 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 17 May 2009 14:55:02 +0000 (16:55 +0200)
midori/midori-locationaction.c
tests/completion.c

index 37fc30d32c1e8cf11a47f72058a0560437f4b710..588f7171abc403f6ce88d545afc0f27c67a1933d 100644 (file)
@@ -189,7 +189,8 @@ midori_location_action_class_init (MidoriLocationActionClass* class)
                                      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 }
 
-static GtkWidget*
+/* Allow this to be used in tests, it's otherwise private */
+/*static*/ GtkWidget*
 midori_location_action_entry_for_proxy (GtkWidget* proxy)
 {
     GtkWidget* alignment = gtk_bin_get_child (GTK_BIN (proxy));
index 86ddb5dfb89d8a236c5a1afb6b9e339633cece0a..80ca112adbd7df1854eeec83544be4e6892b4add 100644 (file)
 
 #include "midori.h"
 
+/* This is a private function */
+GtkWidget*
+midori_location_action_entry_for_proxy (GtkWidget* proxy);
+
 typedef struct
 {
     const gchar* uri;
@@ -41,7 +45,6 @@ completion_count (void)
 {
     MidoriLocationAction* action;
     GtkWidget* toolitem;
-    GtkWidget* alignment;
     GtkWidget* location_entry;
     GtkWidget* entry;
     GtkTreeModel* model;
@@ -49,8 +52,7 @@ completion_count (void)
 
     action = g_object_new (MIDORI_TYPE_LOCATION_ACTION, NULL);
     toolitem = gtk_action_create_tool_item (GTK_ACTION (action));
-    alignment = gtk_bin_get_child (GTK_BIN (toolitem));
-    location_entry = gtk_bin_get_child (GTK_BIN (alignment));
+    location_entry = midori_location_action_entry_for_proxy (toolitem);
     entry = gtk_bin_get_child (GTK_BIN (location_entry));
     model = gtk_combo_box_get_model (GTK_COMBO_BOX (location_entry));
 
@@ -129,7 +131,6 @@ completion_fill (void)
 {
     MidoriLocationAction* action;
     GtkWidget* toolitem;
-    GtkWidget* alignment;
     GtkWidget* location_entry;
     GtkWidget* entry;
     GtkTreeModel* model;
@@ -138,8 +139,7 @@ completion_fill (void)
 
     action = g_object_new (MIDORI_TYPE_LOCATION_ACTION, NULL);
     toolitem = gtk_action_create_tool_item (GTK_ACTION (action));
-    alignment = gtk_bin_get_child (GTK_BIN (toolitem));
-    location_entry = gtk_bin_get_child (GTK_BIN (alignment));
+    location_entry = midori_location_action_entry_for_proxy (toolitem);
     entry = gtk_bin_get_child (GTK_BIN (location_entry));
 
     g_print ("...\n");
@@ -217,7 +217,6 @@ completion_match (void)
 {
     MidoriLocationAction* action;
     GtkWidget* toolitem;
-    GtkWidget* alignment;
     GtkWidget* location_entry;
     GtkWidget* entry;
     GtkEntryCompletion* completion;
@@ -230,8 +229,7 @@ completion_match (void)
     midori_location_action_thaw (action);
 
     toolitem = gtk_action_create_tool_item (GTK_ACTION (action));
-    alignment = gtk_bin_get_child (GTK_BIN (toolitem));
-    location_entry = gtk_bin_get_child (GTK_BIN (alignment));
+    location_entry = midori_location_action_entry_for_proxy (toolitem);
     entry = gtk_bin_get_child (GTK_BIN (location_entry));
     completion = gtk_entry_get_completion (GTK_ENTRY (entry));
     g_signal_connect (completion, "insert-prefix",