Remove a bunch of unused stuff in the gtkblist and set some sane defaults

Fri, 27 May 2022 03:05:57 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 27 May 2022 03:05:57 -0500
changeset 41411
c2969c67490e
parent 41410
3c68dae90dc5
child 41413
911c16e255ff

Remove a bunch of unused stuff in the gtkblist and set some sane defaults

Testing Done:
Ran and verified that the buddylist displayed all options by default now.

Reviewed at https://reviews.imfreedom.org/r/1445/

ChangeLog.API file | annotate | diff | comparison | revisions
doc/reference/pidgin/signals_gtkblist.md file | annotate | diff | comparison | revisions
pidgin/gtkblist.c file | annotate | diff | comparison | revisions
pidgin/gtkblist.h file | annotate | diff | comparison | revisions
pidgin/pidginactiongroup.c file | annotate | diff | comparison | revisions
pidgin/pidginactiongroup.h file | annotate | diff | comparison | revisions
pidgin/resources/BuddyList/window.ui file | annotate | diff | comparison | revisions
--- a/ChangeLog.API	Wed May 25 23:52:46 2022 -0500
+++ b/ChangeLog.API	Fri May 27 03:05:57 2022 -0500
@@ -802,9 +802,12 @@
 		* conversation-dragging (gtkconv signal)
 		* conversation-timestamp (gtkconv signal)
 		* conversation-hiding (gtkconv signal)
+		* drawing-buddy (gtkblist signal)
 		* GtkIMHtml.clipboard_html_string
 		* GtkIMHtml.clipboard_text_string
 		* GtkIMHtmlFontDetail
+		* gtkblist-hiding (gtkblist signal)
+		* gtkblist-unhiding (gtkblist signal)
 		* gtk_imhtml_animation_free
 		* gtk_imhtml_animation_new
 		* gtk_imhtml_image_add_to
--- a/doc/reference/pidgin/signals_gtkblist.md	Wed May 25 23:52:46 2022 -0500
+++ b/doc/reference/pidgin/signals_gtkblist.md	Fri May 27 03:05:57 2022 -0500
@@ -3,37 +3,6 @@
 
 ## Buddy List Signals
 
-### gtkblist-hiding
-
-```c
-void user_function(PurpleBuddyList *blist, gpointer user_data);
-```
-
-Emitted when the buddy list is about to be hidden.
-
-**Parameters:**
-
-**blist**
-: The buddy list.
-
-**user_data**
-: User data set when the signal handler was connected.
-
-### gtkblist-unhiding
-
-```c
-void user_function(PurpleBuddyList *blist, gpointer user_data);
-```
-Emitted when the buddy list is about to be unhidden.
-
-**Parameters:**
-
-**blist**
-: The buddy list.
-
-**user_data**
-: User data set when the signal handler was connected.
-
 ### gtkblist-created
 
 ```c
@@ -73,26 +42,3 @@
 
 **user_data**
 : User data set when the signal handler was connected.
-
-### drawing-buddy
-
-```c
-char *user_function(PurpleBuddy *buddy, gpointer user_data);
-```
-
-Emitted to allow plugins to handle markup within a buddy's name or to override
-the default of no formatting for names shown in the buddy list.
-
-**Parameters:**
-
-**buddy**
-: A pointer to the PupleBuddy that will be displayed.
-
-**user_data**
-: User data set when the signal handler was connected.
-
-**Returns:**
-
-The text to display (must be allocated), or `NULL` if no changes to the default
-behavior are desired.
-
--- a/pidgin/gtkblist.c	Wed May 25 23:52:46 2022 -0500
+++ b/pidgin/gtkblist.c	Fri May 27 03:05:57 2022 -0500
@@ -128,7 +128,6 @@
 	EMBLEM_COLUMN,
 	EMBLEM_VISIBLE_COLUMN,
 	PROTOCOL_ICON_COLUMN,
-	PROTOCOL_ICON_VISIBLE_COLUMN,
 	BLIST_COLUMNS
 };
 
@@ -231,20 +230,6 @@
 	return TRUE;
 }
 
-static void
-gtk_blist_hide_cb(GtkWidget *widget, PidginBuddyList *gtkblist)
-{
-	purple_signal_emit(pidgin_blist_get_handle(),
-			"gtkblist-hiding", gtkblist);
-}
-
-static void
-gtk_blist_show_cb(GtkWidget *widget, PidginBuddyList *gtkblist)
-{
-	purple_signal_emit(pidgin_blist_get_handle(),
-			"gtkblist-unhiding", gtkblist);
-}
-
 static void gtk_blist_menu_info_cb(GtkWidget *w, PurpleBuddy *b)
 {
 	PurpleAccount *account = purple_buddy_get_account(b);
@@ -661,49 +646,6 @@
 	gtk_tree_path_free(path);
 }
 
-static void gtk_blist_menu_showoffline_cb(GtkWidget *w, PurpleBlistNode *node)
-{
-	if (PURPLE_IS_BUDDY(node))
-	{
-		purple_blist_node_set_bool(node, "show_offline",
-		                           !purple_blist_node_get_bool(node, "show_offline"));
-		pidgin_blist_update(purple_blist_get_default(), node);
-	}
-	else if (PURPLE_IS_CONTACT(node))
-	{
-		PurpleBlistNode *bnode;
-		gboolean setting = !purple_blist_node_get_bool(node, "show_offline");
-
-		purple_blist_node_set_bool(node, "show_offline", setting);
-		for (bnode = purple_blist_node_get_first_child(node);
-		     bnode != NULL;
-		     bnode = purple_blist_node_get_sibling_next(bnode))
-		{
-			purple_blist_node_set_bool(bnode, "show_offline", setting);
-			pidgin_blist_update(purple_blist_get_default(), bnode);
-		}
-	} else if (PURPLE_IS_GROUP(node)) {
-		PurpleBlistNode *cnode, *bnode;
-		gboolean setting = !purple_blist_node_get_bool(node, "show_offline");
-
-		purple_blist_node_set_bool(node, "show_offline", setting);
-		for (cnode = purple_blist_node_get_first_child(node);
-		     cnode != NULL;
-		     cnode = purple_blist_node_get_sibling_next(cnode))
-		{
-			purple_blist_node_set_bool(cnode, "show_offline", setting);
-			for (bnode = purple_blist_node_get_first_child(cnode);
-			     bnode != NULL;
-			     bnode = purple_blist_node_get_sibling_next(bnode))
-			{
-				purple_blist_node_set_bool(bnode, "show_offline", setting);
-				pidgin_blist_update(purple_blist_get_default(),
-				                    bnode);
-			}
-		}
-	}
-}
-
 static void
 do_join_chat(PidginChatData *data)
 {
@@ -1456,13 +1398,6 @@
 		}
 	}
 
-	if (!purple_blist_node_is_transient(node)) {
-		gboolean show_offline = purple_blist_node_get_bool(node, "show_offline");
-		pidgin_new_menu_item(menu,
-                                show_offline ? _("Hide When Offline") : _("Show When Offline"),
-				NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node);
-	}
-
 	pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(purple_buddy_get_account(buddy)), node);
 	pidgin_append_blist_node_extended_menu(menu, node);
 
@@ -1638,12 +1573,6 @@
 				 G_CALLBACK(pidgin_blist_remove_cb), node);
 	pidgin_new_menu_item(menu, _("_Rename"), NULL,
 				 G_CALLBACK(gtk_blist_menu_alias_cb), node);
-	if (!purple_blist_node_is_transient(node)) {
-		gboolean show_offline = purple_blist_node_get_bool(node, "show_offline");
-		pidgin_new_menu_item(menu,
-                                show_offline ? _("Hide When Offline") : _("Show When Offline"),
-				NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node);
-	}
 
 	add_buddy_icon_menu_items(menu, node);
 
@@ -1718,7 +1647,6 @@
 	PidginBlistNode *gtknode = g_object_get_data(G_OBJECT(node), UI_DATA);
 	GtkWidget *menu;
 	GtkWidget *menuitem;
-	gboolean show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies");
 
 	menu = gtk_menu_new();
 	pidgin_blist_make_buddy_menu(menu, b, FALSE);
@@ -1750,8 +1678,6 @@
 					continue;
 				if(!purple_account_get_connection(purple_buddy_get_account(buddy)))
 					continue;
-				if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy))
-					continue;
 
 				menuitem = gtk_menu_item_new_with_label(purple_buddy_get_name(buddy));
 				gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
@@ -2082,18 +2008,10 @@
 
 static gboolean buddy_is_displayable(PurpleBuddy *buddy)
 {
-	PidginBlistNode *gtknode;
-
 	if(!buddy)
 		return FALSE;
 
-	gtknode = g_object_get_data(G_OBJECT(buddy), UI_DATA);
-
-	return (purple_account_is_connected(purple_buddy_get_account(buddy)) &&
-			(purple_presence_is_online(purple_buddy_get_presence(buddy)) ||
-			 (gtknode && gtknode->recent_signonoff) ||
-			 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies") ||
-			 purple_blist_node_get_bool(PURPLE_BLIST_NODE(buddy), "show_offline")));
+	return purple_account_is_connected(purple_buddy_get_account(buddy));
 }
 
 /* # - Status Icon
@@ -2699,9 +2617,7 @@
 
 		pidgin_node = g_object_get_data(G_OBJECT(node->parent), UI_DATA);
 		if(pidgin_node->contact_expanded) {
-			if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"))
-				return NULL;
-			return pidgin_create_protocol_icon(purple_buddy_get_account((PurpleBuddy*)node), PIDGIN_PROTOCOL_ICON_SMALL);
+			return NULL;
 		}
 	} else {
 		return NULL;
@@ -2889,12 +2805,7 @@
 	else
 		name = purple_buddy_get_alias(b);
 
-	/* Raise a contact pre-draw signal here.  THe callback will return an
-	 * escaped version of the name. */
-	nametext = purple_signal_emit_return_1(pidgin_blist_get_handle(), "drawing-buddy", b);
-
-	if(!nametext)
-		nametext = g_markup_escape_text(name, strlen(name));
+	nametext = g_markup_escape_text(name, strlen(name));
 
 	presence = purple_buddy_get_presence(b);
 
@@ -2927,7 +2838,7 @@
 				statustext = g_strdup(_("Offline"));
 
 		/* Idle Text */
-		if (purple_presence_is_idle(presence) && purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")) {
+		if (purple_presence_is_idle(presence)) {
 			time_t idle_secs = purple_presence_get_idle_time(presence);
 
 			if (idle_secs > 0) {
@@ -3178,38 +3089,6 @@
 	pidgin_blist_sort_method_set(id);
 }
 
-static void _prefs_change_redo_list(const char *name, PurplePrefType type,
-                                    gconstpointer val, gpointer data)
-{
-	GtkTreeSelection *sel;
-	GtkTreeIter iter;
-	PurpleBlistNode *node = NULL;
-
-	sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview));
-	if (gtk_tree_selection_get_selected(sel, NULL, &iter))
-	{
-		gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1);
-	}
-
-	redo_buddy_list(purple_blist_get_default(), FALSE, FALSE);
-	gtk_tree_view_columns_autosize(GTK_TREE_VIEW(gtkblist->treeview));
-
-	if (node)
-	{
-		PidginBlistNode *gtknode;
-		GtkTreePath *path;
-
-		gtknode = g_object_get_data(G_OBJECT(node), UI_DATA);
-		if (gtknode && gtknode->row)
-		{
-			path = gtk_tree_row_reference_get_path(gtknode->row);
-			gtk_tree_selection_select_path(sel, path);
-			gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0);
-			gtk_tree_path_free(path);
-		}
-	}
-}
-
 static void _prefs_change_sort_method(const char *pref_name, PurplePrefType type,
 									  gconstpointer val, gpointer data)
 {
@@ -3809,7 +3688,6 @@
 	gtk_tree_view_column_pack_start(column, rend, FALSE);
 	gtk_tree_view_column_set_attributes(column, rend,
 	                                    "pixbuf", PROTOCOL_ICON_COLUMN,
-	                                    "visible", PROTOCOL_ICON_VISIBLE_COLUMN,
 	                                    NULL);
 	g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL);
 
@@ -3896,10 +3774,6 @@
 	gtkblist->vbox = pidgin_contact_list_get_vbox(PIDGIN_CONTACT_LIST(gtkblist->window));
 
 	g_signal_connect(G_OBJECT(gtkblist->window), "delete_event", G_CALLBACK(gtk_blist_delete_cb), NULL);
-	g_signal_connect(G_OBJECT(gtkblist->window), "hide",
-	                 G_CALLBACK(gtk_blist_hide_cb), gtkblist);
-	g_signal_connect(G_OBJECT(gtkblist->window), "show",
-	                 G_CALLBACK(gtk_blist_show_cb), gtkblist);
 	g_signal_connect(G_OBJECT(gtkblist->window), "visibility_notify_event", G_CALLBACK(gtk_blist_visibility_cb), NULL);
 	g_signal_connect(G_OBJECT(gtkblist->window), "window_state_event", G_CALLBACK(gtk_blist_window_state_cb), NULL);
 	gtk_widget_add_events(gtkblist->window, GDK_VISIBILITY_NOTIFY_MASK);
@@ -3917,8 +3791,7 @@
 						 G_TYPE_BOOLEAN,  /* Contact expander visible */
 						 GDK_TYPE_PIXBUF, /* Emblem */
 						 G_TYPE_BOOLEAN,  /* Emblem visible */
-						 GDK_TYPE_PIXBUF, /* Protocol icon */
-						 G_TYPE_BOOLEAN   /* Protocol visible */
+						 GDK_TYPE_PIXBUF /* Protocol icon */
 						);
 
 	gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel));
@@ -3993,16 +3866,6 @@
 
 	handle = pidgin_blist_get_handle();
 
-	/* things that affect how buddies are displayed */
-	purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_idle_time",
-			_prefs_change_redo_list, NULL);
-	purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
-			_prefs_change_redo_list, NULL);
-	purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
-			_prefs_change_redo_list, NULL);
-	purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_protocol_icons",
-			_prefs_change_redo_list, NULL);
-
 	/* sorting */
 	purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/sort_type",
 			_prefs_change_sort_method, NULL);
@@ -4213,34 +4076,14 @@
 	return TRUE;
 }
 
-static gboolean pidgin_blist_group_has_show_offline_buddy(PurpleGroup *group)
-{
-	PurpleBlistNode *gnode, *cnode, *bnode;
-
-	gnode = PURPLE_BLIST_NODE(group);
-	for(cnode = gnode->child; cnode; cnode = cnode->next) {
-		if(PURPLE_IS_CONTACT(cnode)) {
-			for(bnode = cnode->child; bnode; bnode = bnode->next) {
-				PurpleBuddy *buddy = (PurpleBuddy *)bnode;
-				if (purple_account_is_connected(purple_buddy_get_account(buddy)) &&
-					purple_blist_node_get_bool(bnode, "show_offline"))
-					return TRUE;
-			}
-		}
-	}
-	return FALSE;
-}
-
 /* This version of pidgin_blist_update_group can take the original buddy or a
  * group, but has much better algorithmic performance with a pre-known buddy.
  */
 static void pidgin_blist_update_group(PurpleBuddyList *list,
                                       PurpleBlistNode *node)
 {
-	gint count;
-	PurpleGroup *group;
 	PurpleBlistNode* gnode;
-	gboolean show = FALSE, show_offline = FALSE;
+	gboolean show = FALSE;
 
 	g_return_if_fail(node != NULL);
 
@@ -4256,22 +4099,7 @@
 	else
 		return;
 
-	group = (PurpleGroup*)gnode;
-
-	show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies");
-
-	if(show_offline)
-		count = purple_counting_node_get_current_size(PURPLE_COUNTING_NODE(group));
-	else
-		count = purple_counting_node_get_online_count(PURPLE_COUNTING_NODE(group));
-
-	if (count > 0 || purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups"))
-		show = TRUE;
-	else if (PURPLE_IS_BUDDY(node) && buddy_is_displayable((PurpleBuddy*)node)) { /* Or chat? */
-		show = TRUE;
-	} else if (!show_offline) {
-		show = pidgin_blist_group_has_show_offline_buddy(group);
-	}
+	show = TRUE;
 
 	if (show) {
 		gchar *title;
@@ -4378,7 +4206,6 @@
 			   EMBLEM_COLUMN, emblem,
 			   EMBLEM_VISIBLE_COLUMN, (emblem != NULL),
 			   PROTOCOL_ICON_COLUMN, protocol_icon,
-			   PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
 			   CONTACT_EXPANDER_COLUMN, NULL,
 			   CONTACT_EXPANDER_VISIBLE_COLUMN, pidgin_node->contact_expanded,
 			   GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
@@ -4547,7 +4374,6 @@
 				EMBLEM_COLUMN, emblem,
 				EMBLEM_VISIBLE_COLUMN, emblem != NULL,
 				PROTOCOL_ICON_COLUMN, protocol_icon,
-				PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"),
 				NAME_COLUMN, mark,
 				GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
 				-1);
@@ -5108,27 +4934,19 @@
 
 	/* Remove old prefs */
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons");
+	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_empty_groups");
+	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_idle_time");
+	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies");
+	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons");
 
 	/* Initialize prefs */
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/blist");
-	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", FALSE);
-	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", TRUE);
-	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", FALSE);
-	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", FALSE);
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE);
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE);
 	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/sort_type", "alphabetical");
 	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/theme", "");
 
 	/* Register our signals */
-	purple_signal_register(gtk_blist_handle, "gtkblist-hiding",
-	                     purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
-	                     PURPLE_TYPE_BUDDY_LIST);
-
-	purple_signal_register(gtk_blist_handle, "gtkblist-unhiding",
-	                     purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
-	                     PURPLE_TYPE_BUDDY_LIST);
-
 	purple_signal_register(gtk_blist_handle, "gtkblist-created",
 	                     purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
 	                     PURPLE_TYPE_BUDDY_LIST);
@@ -5139,10 +4957,6 @@
 	                     G_TYPE_POINTER, /* pointer to a (GString *) */
 	                     G_TYPE_BOOLEAN);
 
-	purple_signal_register(gtk_blist_handle, "drawing-buddy",
-						purple_marshal_POINTER__POINTER,
-						G_TYPE_STRING, 1, PURPLE_TYPE_BUDDY);
-
 	purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on",
 			gtk_blist_handle, G_CALLBACK(buddy_signonoff_cb), NULL);
 	purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off",
--- a/pidgin/gtkblist.h	Wed May 25 23:52:46 2022 -0500
+++ b/pidgin/gtkblist.h	Fri May 27 03:05:57 2022 -0500
@@ -45,9 +45,6 @@
  **************************************************************************/
 /**
  * PidginBuddyList:
- * @notebook:          The notebook that switches between the real buddy list
- *                     and the helpful instructions page
- * @main_vbox:         This vbox contains the menu and notebook
  * @vbox:              This is the vbox that everything important gets packed
  *                     into.  Your plugin might want to pack something in it
  *                     itself.  Go, plugins!
@@ -55,20 +52,8 @@
  * @treemodel:         This is the treemodel.
  * @text_column:       Column
  * @refresh_timer:     The timer for refreshing every 30 seconds
- * @contact_rect:      This is the bounding rectangle of the contact node and
- *                     its children.  This is used for auto-expand on mouseover.
- * @mouseover_contact: This is the contact currently mouse-over expanded
  * @selected_node:     The currently selected node
  * @scrollbook:        Scrollbook for alerts
- * @headline:          Widget for headline notifications
- * @headline_label:    Label for headline notifications
- * @headline_image:    Image for headline notifications
- * @headline_callback: Callback for headline notifications
- * @headline_data:     User data for headline notifications
- * @headline_destroy:  Callback to use for destroying the headline-data
- * @statusbox:         The status selector dropdown
- * @empty_avatar:      A 32x32 transparent pixbuf
- * @priv:              Pointer to opaque private data
  *
  * Like, everything you need to know about the gtk buddy list
  */
@@ -88,9 +73,6 @@
 
 	guint refresh_timer;
 
-	GdkRectangle contact_rect;
-	PurpleBlistNode *mouseover_contact;
-
 	PurpleBlistNode *selected_node;
 
 	GtkWidget *scrollbook;
--- a/pidgin/pidginactiongroup.c	Wed May 25 23:52:46 2022 -0500
+++ b/pidgin/pidginactiongroup.c	Fri May 27 03:05:57 2022 -0500
@@ -35,70 +35,6 @@
  *****************************************************************************/
 
 /*< private >
- * pidgin_action_group_bool_pref_handler:
- * @group: The #PidginActionGroup instance.
- * @action_name: The name of the action to update.
- * @value: The value of the preference.
- *
- * Changes the state of the action named @action_name to match @value.
- *
- * This function is meant to be called from a #PurplePrefCallback function as
- * there isn't a good way to have a #PurplePrefCallback with multiple items in
- * the data parameter without leaking them forever.
- */
-static void
-pidgin_action_group_bool_pref_handler(PidginActionGroup *group,
-                                      const gchar *action_name,
-                                      gboolean value)
-{
-	GAction *action = NULL;
-
-	action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name);
-	if(action != NULL) {
-		g_simple_action_set_state(G_SIMPLE_ACTION(action),
-		                          g_variant_new_boolean(value));
-	}
-}
-
-/*< private >
- * pidgin_action_group_setup_bool:
- * @group: The #PidginActionGroup instance.
- * @action_name: The name of the action to setup.
- * @pref_name: The name of the preference that @action_name is tied to.
- * @callback: (scope notified): A #PurplePrefCallback to call when the
- *            preference is changed.
- *
- * Initializes the boolean action named @action_name to the value of @pref_name
- * and setups up a preference change callback to @callback to maintain the
- * state of the action.
- */
-static void
-pidgin_action_group_setup_bool(PidginActionGroup *group,
-                               const gchar *action_name,
-                               const gchar *pref_name,
-                               PurplePrefCallback callback)
-{
-	GAction *action = NULL;
-	gboolean value = FALSE;
-
-	/* find the action, if we can't find it, bail */
-	action = g_action_map_lookup_action(G_ACTION_MAP(group), action_name);
-	g_return_if_fail(action != NULL);
-
-	/* get the value of the preference */
-	value = purple_prefs_get_bool(pref_name);
-
-	/* change the state of the action to match the preference value. */
-	g_simple_action_set_state(G_SIMPLE_ACTION(action),
-	                          g_variant_new_boolean(value));
-
-	/* finally add a preference callback to update the state based on the
-	 * preference.
-	 */
-	purple_prefs_connect_callback(group, pref_name, callback, group);
-}
-
-/*< private >
  * pidgin_action_group_string_pref_handler:
  * @group: The #PidginActionGroup instance.
  * @action_name: The name of the action to update.
@@ -164,58 +100,6 @@
  * Preference Callbacks
  *****************************************************************************/
 static void
-pidgin_action_group_show_empty_groups_callback(const gchar *name,
-                                               PurplePrefType type,
-                                               gconstpointer value,
-                                               gpointer data)
-{
-	PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
-
-	pidgin_action_group_bool_pref_handler(group,
-	                                      PIDGIN_ACTION_SHOW_EMPTY_GROUPS,
-	                                      (gboolean)GPOINTER_TO_INT(value));
-}
-
-static void
-pidgin_action_group_show_idle_times_callback(const gchar *name,
-                                             PurplePrefType type,
-                                             gconstpointer value,
-                                             gpointer data)
-{
-	PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
-
-	pidgin_action_group_bool_pref_handler(group,
-	                                      PIDGIN_ACTION_SHOW_IDLE_TIMES,
-	                                      (gboolean)GPOINTER_TO_INT(value));
-}
-
-static void
-pidgin_action_group_show_offline_buddies_callback(const gchar *name,
-                                                  PurplePrefType type,
-                                                  gconstpointer value,
-                                                  gpointer data)
-{
-	PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
-
-	pidgin_action_group_bool_pref_handler(group,
-	                                      PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES,
-	                                      (gboolean)GPOINTER_TO_INT(value));
-}
-
-static void
-pidgin_action_group_show_protocol_icons_callback(const gchar *name,
-                                                 PurplePrefType type,
-                                                 gconstpointer value,
-                                                 gpointer data)
-{
-	PidginActionGroup *group = PIDGIN_ACTION_GROUP(data);
-
-	pidgin_action_group_bool_pref_handler(group,
-	                                      PIDGIN_ACTION_SHOW_PROTOCOL_ICONS,
-	                                      (gboolean)GPOINTER_TO_INT(value));
-}
-
-static void
 pidgin_action_group_sort_method_callback(const gchar *name,
                                          PurplePrefType type,
                                          gconstpointer value,
@@ -232,41 +116,6 @@
  * Action Callbacks
  *****************************************************************************/
 static void
-pidgin_action_group_show_empty_groups(GSimpleAction *action, GVariant *value,
-                                      gpointer data)
-{
-	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
-	                      g_variant_get_boolean(value));
-}
-
-static void
-pidgin_action_group_show_idle_times(GSimpleAction *action,
-                                    GVariant *value,
-                                    gpointer data)
-{
-	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time",
-	                      g_variant_get_boolean(value));
-}
-
-static void
-pidgin_action_group_show_offline_buddies(GSimpleAction *action,
-                                         GVariant *value,
-                                         gpointer data)
-{
-	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
-	                      g_variant_get_boolean(value));
-}
-
-static void
-pidgin_action_group_show_protocol_icons(GSimpleAction *action,
-                                        GVariant *value,
-                                        gpointer data)
-{
-	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons",
-	                      g_variant_get_boolean(value));
-}
-
-static void
 pidgin_action_group_sort_method(GSimpleAction *action, GVariant *value,
                                 gpointer data)
 {
@@ -284,22 +133,6 @@
 pidgin_action_group_init(PidginActionGroup *group) {
 	GActionEntry entries[] = {
 		{
-			.name = PIDGIN_ACTION_SHOW_EMPTY_GROUPS,
-			.state = "false",
-			.change_state = pidgin_action_group_show_empty_groups,
-		}, {
-			.name = PIDGIN_ACTION_SHOW_IDLE_TIMES,
-			.state = "false",
-			.change_state = pidgin_action_group_show_idle_times,
-		}, {
-			.name = PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES,
-			.state = "false",
-			.change_state = pidgin_action_group_show_offline_buddies,
-		}, {
-			.name = PIDGIN_ACTION_SHOW_PROTOCOL_ICONS,
-			.state = "false",
-			.change_state = pidgin_action_group_show_protocol_icons,
-		}, {
 			.name = PIDGIN_ACTION_SORT_METHOD,
 			.parameter_type = "s",
 			.state = "'none'",
@@ -313,19 +146,6 @@
 	/* now add some handlers for preference changes and set actions to the
 	 * correct value.
 	 */
-	pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_EMPTY_GROUPS,
-	                               PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
-	                               pidgin_action_group_show_empty_groups_callback);
-	pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_IDLE_TIMES,
-	                               PIDGIN_PREFS_ROOT "/blist/show_idle_time",
-	                               pidgin_action_group_show_idle_times_callback);
-	pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES,
-	                               PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
-	                               pidgin_action_group_show_offline_buddies_callback);
-	pidgin_action_group_setup_bool(group, PIDGIN_ACTION_SHOW_PROTOCOL_ICONS,
-	                               PIDGIN_PREFS_ROOT "/blist/show_protocol_icons",
-	                               pidgin_action_group_show_protocol_icons_callback);
-
 	pidgin_action_group_setup_string(group, PIDGIN_ACTION_SORT_METHOD,
 	                                 PIDGIN_PREFS_ROOT "/blist/sort_type",
 	                                 pidgin_action_group_sort_method_callback);
--- a/pidgin/pidginactiongroup.h	Wed May 25 23:52:46 2022 -0500
+++ b/pidgin/pidginactiongroup.h	Fri May 27 03:05:57 2022 -0500
@@ -42,41 +42,6 @@
  */
 
 /**
- * PIDGIN_ACTION_SHOW_BUDDY_ICONS:
- *
- * A constant that represents the show-buddy-icons action.
- */
-#define PIDGIN_ACTION_SHOW_BUDDY_ICONS ("show-buddy-icons")
-
-/**
- * PIDGIN_ACTION_SHOW_EMPTY_GROUPS:
- *
- * A constant that represents the show-empty-groups action.
- */
-#define PIDGIN_ACTION_SHOW_EMPTY_GROUPS ("show-empty-groups")
-
-/**
- * PIDGIN_ACTION_SHOW_IDLE_TIMES:
- *
- * A constant that represents the show-idle-times action.
- */
-#define PIDGIN_ACTION_SHOW_IDLE_TIMES ("show-idle-times")
-
-/**
- * PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES:
- *
- * A constant that represents the show-offline-buddies action.
- */
-#define PIDGIN_ACTION_SHOW_OFFLINE_BUDDIES ("show-offline-buddies")
-
-/**
- * PIDGIN_ACTION_SHOW_PROTOCOL_ICONS:
- *
- * A constant that represents the show-protocol-icons action.
- */
-#define PIDGIN_ACTION_SHOW_PROTOCOL_ICONS ("show-protocol-icons")
-
-/**
  * PIDGIN_ACTION_SORT_METHOD:
  *
  * A constant that represents the sort-method action to change the sorting
--- a/pidgin/resources/BuddyList/window.ui	Wed May 25 23:52:46 2022 -0500
+++ b/pidgin/resources/BuddyList/window.ui	Fri May 27 03:05:57 2022 -0500
@@ -50,56 +50,6 @@
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
                     <child>
-                      <object class="GtkMenuItem">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="label" translatable="yes">Sh_ow</property>
-                        <property name="use-underline">True</property>
-                        <child type="submenu">
-                          <object class="GtkMenu">
-                            <property name="visible">True</property>
-                            <property name="can-focus">False</property>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="show_offline_buddies">
-                                <property name="visible">True</property>
-                                <property name="can-focus">False</property>
-                                <property name="action-name">blist.show-offline-buddies</property>
-                                <property name="label" translatable="yes">_Offline Buddies</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="show_empty_groups">
-                                <property name="visible">True</property>
-                                <property name="can-focus">False</property>
-                                <property name="action-name">blist.show-empty-groups</property>
-                                <property name="label" translatable="yes">_Empty Groups</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="show_idle_times">
-                                <property name="visible">True</property>
-                                <property name="can-focus">False</property>
-                                <property name="action-name">blist.show-idle-times</property>
-                                <property name="label" translatable="yes">Idle _Times</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="show_protocol_icons">
-                                <property name="visible">True</property>
-                                <property name="can-focus">False</property>
-                                <property name="action-name">blist.show-protocol-icons</property>
-                                <property name="label" translatable="yes">_Protocol Icons</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                    <child>
                       <object class="GtkMenuItem" id="sort_buddies">
                         <property name="visible">True</property>
                         <property name="can-focus">False</property>

mercurial