SF.net SVN: geany:[5716] trunk/src

eht16 at users.sourceforge.net eht16 at xxxxx
Tue Apr 12 17:43:00 UTC 2011


Revision: 5716
          http://geany.svn.sourceforge.net/geany/?rev=5716&view=rev
Author:   eht16
Date:     2011-04-12 17:43:00 +0000 (Tue, 12 Apr 2011)

Log Message:
-----------
fix function signature (oops)
replace sort_func by compare_func

Modified Paths:
--------------
    trunk/src/plugindata.h
    trunk/src/ui_utils.c

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2011-04-12 17:24:13 UTC (rev 5715)
+++ trunk/src/plugindata.h	2011-04-12 17:43:00 UTC (rev 5716)
@@ -310,7 +310,7 @@
 	const GdkColor*	(*document_get_status_color) (struct GeanyDocument *doc);
 	gchar*		(*document_get_basename_for_display) (struct GeanyDocument *doc, gint length);
 	gint		(*document_get_notebook_page) (struct GeanyDocument *doc);
-	gint		(*document_compare_by_display_name) (const struct GeanyDocument **a, const struct GeanyDocument **b);
+	gint		(*document_compare_by_display_name) (gconstpointer a, gconstpointer b);
 }
 DocumentFuncs;
 
@@ -475,7 +475,7 @@
 	void		(*ui_combo_box_add_to_history) (GtkComboBoxEntry *combo_entry,
 				const gchar *text, gint history_len);
 	void		(*ui_menu_add_document_items_sorted) (GtkMenu *menu, struct GeanyDocument *active,
-				GCallback callback, GCompareFunc sort_func);
+				GCallback callback, GCompareFunc compare_func);
 }
 UIUtilsFuncs;
 

Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c	2011-04-12 17:24:13 UTC (rev 5715)
+++ trunk/src/ui_utils.c	2011-04-12 17:43:00 UTC (rev 5716)
@@ -2400,7 +2400,7 @@
 
 /** Adds a list of document items to @a menu.
  *
- * @a sort_func might be NULL to not sort the documents in the menu. In this case,
+ * @a compare_func might be NULL to not sort the documents in the menu. In this case,
  * the order of the document tabs is used.
  *
  * See document_sort_by_display_name() for an example sort function.
@@ -2409,11 +2409,11 @@
  * @param active Which document to highlight, or @c NULL.
  * @param callback is used for each menu item's @c "activate" signal and will be passed
  * the corresponding document pointer as @c user_data.
- * @param sort_func is used to sort the list. Might be @c NULL to not sort the list.
+ * @param compare_func is used to sort the list. Might be @c NULL to not sort the list.
  * @warning You should check @c doc->is_valid in the callback.
  * @since 0.21 */
 void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active,
-	GCallback callback, GCompareFunc sort_func)
+	GCallback callback, GCompareFunc compare_func)
 {
 	GtkWidget *menu_item, *menu_item_label, *image;
 	const GdkColor *color;
@@ -2432,8 +2432,8 @@
 			g_ptr_array_add(sorted_documents, documents[i]);
 	}
 	/* and now sort it */
-	if (sort_func != NULL)
-		g_ptr_array_sort(sorted_documents, sort_func);
+	if (compare_func != NULL)
+		g_ptr_array_sort(sorted_documents, compare_func);
 
 	for (i = 0; i < sorted_documents->len; i++)
 	{


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list