Very small patches for review (correct format, and one extra)



egg-toolbars-model:
  Removed unused struct.

ephy-bookmarks-menu:
  Do not add bookmarks to a flat menu more than once.
  Bookmarks may still appear at different places in the hierarchy.

ephy-find-toolbar:
  Change toolbar label if searching for links or text.

ephy-node:
  Skip writing out a string property if it is NULL (fixes segfault).

Index: lib/egg/egg-toolbars-model.h
===================================================================
RCS file: /cvs/gnome/epiphany/lib/egg/egg-toolbars-model.h,v
retrieving revision 1.22
diff -u -r1.22 egg-toolbars-model.h
--- lib/egg/egg-toolbars-model.h	16 Oct 2005 20:29:02 -0000	1.22
+++ lib/egg/egg-toolbars-model.h	6 Jan 2006 02:57:09 -0000
@@ -102,12 +102,6 @@
                          const char          *data);
 };
 
-struct EggToolbarsItemAvailable
-{
-  const char * name;
-  guint        available;
-};
-
 GType		  egg_toolbars_model_flags_get_type (void);
 GType		  egg_toolbars_model_get_type       (void);
 EggToolbarsModel *egg_toolbars_model_new	    (void);
Index: src/bookmarks/ephy-bookmarks-menu.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmarks-menu.c,v
retrieving revision 1.42
diff -u -r1.42 ephy-bookmarks-menu.c
--- src/bookmarks/ephy-bookmarks-menu.c	16 Oct 2005 20:29:26 -0000	1.42
+++ src/bookmarks/ephy-bookmarks-menu.c	6 Jan 2006 02:56:44 -0000
@@ -74,14 +74,14 @@
 append_menu (GString *string, const GPtrArray *topics, const GPtrArray *bookmarks, guint flags)
 {
 	GPtrArray *uncovered;
-	guint i;
+	guint i, j;
 	
 	gboolean use_subdivis = flags & BUILD_SUBDIVIS;
 	gboolean use_submenus = flags & BUILD_SUBMENUS;        
 
 	if (use_subdivis || use_submenus)
 	{
-		GPtrArray *subset, *covering, *subdivisions, *submenus;
+		GPtrArray *subset, *covering, *subdivisions, *submenus, *unused;
 		GArray *sizes = 0;
 		EphyNode *topic;
 		gint size, total;
@@ -97,6 +97,7 @@
 		subdivisions = g_ptr_array_sized_new (topics->len);
 		submenus = g_ptr_array_sized_new (topics->len);
 		subset = g_ptr_array_sized_new (bookmarks->len);
+		unused = g_ptr_array_sized_new (bookmarks->len);
 
 		/* Get the total number of items in the menu. */
 		total = uncovered->len;
@@ -144,17 +145,29 @@
 				g_free (name);
 			}
 		}
+		
+		/* Build a list of bookmarks which don't appear in any subdivision yet. */
+		for (i = 0; i < bookmarks->len; i++)
+		{
+			g_ptr_array_add (unused, g_ptr_array_index (bookmarks, i));
+		}
 
 		/* Create each of the subdivisions. */
 		for (i = 0; i < subdivisions->len; i++)
 		{
 			topic = g_ptr_array_index (subdivisions, i);
-			ephy_nodes_get_covered (topic, bookmarks, subset);
+			ephy_nodes_get_covered (topic, unused, subset);
 			g_ptr_array_sort (subset, ephy_bookmarks_compare_bookmark_pointers);
 			
 			if (separate) g_string_append (string, "<separator/>");
 			append_bookmarks (string, subset, i+1);
 			separate = TRUE;
+			
+			/* Record that each bookmark has been added. */
+			for (j = 0; j < subset->len; j++)
+			{
+				g_ptr_array_remove_fast (unused, g_ptr_array_index (subset, j));
+			}
 		}
 
 		g_array_free (sizes, TRUE);
@@ -162,6 +175,7 @@
 		g_ptr_array_free (subdivisions, TRUE);
 		g_ptr_array_free (submenus, TRUE);
 		g_ptr_array_free (subset, TRUE);
+		g_ptr_array_free (unused, TRUE);
 		
 		if (separate && uncovered->len) g_string_append (string, "<separator/>");
 	}
Index: src/ephy-find-toolbar.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-find-toolbar.c,v
retrieving revision 1.24
diff -u -r1.24 ephy-find-toolbar.c
--- src/ephy-find-toolbar.c	7 Dec 2005 18:15:33 -0000	1.24
+++ src/ephy-find-toolbar.c	6 Jan 2006 02:56:34 -0000
@@ -48,6 +48,7 @@
 	EphyWindow *window;
 	EphyEmbed *embed;
 	GtkWidget *entry;
+	GtkWidget *label;
 	GtkToolItem *next;
 	GtkToolItem *prev;
 	GtkToolItem *sep;
@@ -147,6 +148,8 @@
 	gtk_widget_hide (GTK_WIDGET (priv->sep));
 	gtk_widget_hide (GTK_WIDGET (priv->status_item));
 	gtk_label_set_text (GTK_LABEL (priv->status_label), "");
+	gtk_label_set_text (GTK_LABEL (priv->label),
+			    priv->links_only ? _("Find links:") : _("Find:"));
 }
 
 static void
@@ -370,7 +373,7 @@
 	EphyFindToolbarPrivate *priv;
 	GtkToolbar *gtoolbar;
 	GtkToolItem *item;
-	GtkWidget *alignment, *arrow, *box, *label;
+	GtkWidget *alignment, *arrow, *box;
 
 	priv = toolbar->priv = EPHY_FIND_TOOLBAR_GET_PRIVATE (toolbar);
 	gtoolbar = GTK_TOOLBAR (toolbar);
@@ -384,9 +387,8 @@
 	box = gtk_hbox_new (FALSE, 12);
 	gtk_container_add (GTK_CONTAINER (alignment), box);
 
-	label = gtk_label_new (NULL);
-	gtk_label_set_markup (GTK_LABEL (label), _("Find:"));
-	gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
+	priv->label = gtk_label_new (NULL);
+	gtk_box_pack_start (GTK_BOX (box), priv->label, FALSE, FALSE, 0);
 
 	priv->entry = gtk_entry_new ();
 	gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), 32);
@@ -401,7 +403,6 @@
 
 	/* Prev */
 	arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
-	label = gtk_label_new (_("Find Previous"));
 	priv->prev = gtk_tool_button_new (arrow, _("Find Previous"));
 	gtk_tool_item_set_is_important (priv->prev, TRUE);
 	gtk_tool_item_set_tooltip (priv->prev, gtoolbar->tooltips,
@@ -412,7 +413,6 @@
 
 	/* Next */
 	arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
-	label = gtk_label_new (_("Find Next"));
 	priv->next = gtk_tool_button_new (arrow, _("Find Next"));
 	gtk_tool_item_set_is_important (priv->next, TRUE);
 	gtk_tool_item_set_tooltip (priv->next, gtoolbar->tooltips,






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