pidgin/pidgin

Remove purple_chat_user_[sg]et_ui_data.

2020-08-22, Elliott Sales de Andrade
d587dad11411
Parents 5211982886af
Children 974dbfd7e52f
Remove purple_chat_user_[sg]et_ui_data.

Remove `purple_chat_user_[gs]et_ui_data`.
Remove `deleting-chat-user` signal. It's unused now, and just a substitute for a finalization notification.

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/83/
--- a/libpurple/conversations.c Sat Aug 22 03:45:42 2020 -0500
+++ b/libpurple/conversations.c Sat Aug 22 04:02:53 2020 -0500
@@ -406,10 +406,6 @@
G_TYPE_NONE, 3, PURPLE_TYPE_CHAT_CONVERSATION,
G_TYPE_STRING, G_TYPE_STRING);
- purple_signal_register(handle, "deleting-chat-user",
- purple_marshal_VOID__POINTER, G_TYPE_NONE, 1,
- PURPLE_TYPE_CHAT_USER);
-
purple_signal_register(handle, "chat-inviting-user",
purple_marshal_VOID__POINTER_POINTER_POINTER,
G_TYPE_NONE, 3, PURPLE_TYPE_CHAT_CONVERSATION,
--- a/libpurple/purplechatuser.c Sat Aug 22 03:45:42 2020 -0500
+++ b/libpurple/purplechatuser.c Sat Aug 22 04:02:53 2020 -0500
@@ -154,9 +154,6 @@
purple_chat_user_finalize(GObject *object) {
PurpleChatUser *chat_user = PURPLE_CHAT_USER(object);
- purple_signal_emit(purple_conversations_get_handle(),
- "deleting-chat-user", chat_user);
-
g_free(chat_user->alias);
g_free(chat_user->alias_key);
g_free(chat_user->name);
@@ -273,20 +270,6 @@
}
void
-purple_chat_user_set_ui_data(PurpleChatUser *chat_user, gpointer ui_data) {
- g_return_if_fail(PURPLE_IS_CHAT_USER(chat_user));
-
- chat_user->ui_data = ui_data;
-}
-
-gpointer
-purple_chat_user_get_ui_data(PurpleChatUser *chat_user) {
- g_return_val_if_fail(PURPLE_IS_CHAT_USER(chat_user), NULL);
-
- return chat_user->ui_data;
-}
-
-void
purple_chat_user_set_chat(PurpleChatUser *chat_user,
PurpleChatConversation *chat)
{
--- a/libpurple/purplechatuser.h Sat Aug 22 03:45:42 2020 -0500
+++ b/libpurple/purplechatuser.h Sat Aug 22 04:02:53 2020 -0500
@@ -120,31 +120,6 @@
PurpleChatConversation *purple_chat_user_get_chat(PurpleChatUser *chat_user);
/**
- * purple_chat_user_set_ui_data:
- * @chat_user: The chat user
- * @ui_data: A pointer to associate with this chat user.
- *
- * Set the UI data associated with this chat user.
- *
- * Since: 3.0.0
- */
-void purple_chat_user_set_ui_data(PurpleChatUser *chat_user, gpointer ui_data);
-
-/**
- * purple_chat_user_get_ui_data:
- * @chat_user: The chat user.
- *
- * Get the UI data associated with this chat user.
- *
- * Returns: (transfer none): The UI data associated with this chat user. This
- * is a convenience field provided to the UIs--it is not used by the
- * libpurple core.
- *
- * Since: 3.0.0
- */
-gpointer purple_chat_user_get_ui_data(PurpleChatUser *chat_user);
-
-/**
* purple_chat_user_get_alias:
* @chat_user: The chat user.
*
--- a/pidgin/gtkconv.c Sat Aug 22 03:45:42 2020 -0500
+++ b/pidgin/gtkconv.c Sat Aug 22 04:02:53 2020 -0500
@@ -3478,17 +3478,6 @@
}
static void
-deleting_chat_user_cb(PurpleChatUser *cb)
-{
- GtkTreeRowReference *ref = purple_chat_user_get_ui_data(cb);
-
- if (ref) {
- gtk_tree_row_reference_free(ref);
- purple_chat_user_set_ui_data(cb, NULL);
- }
-}
-
-static void
add_chat_user_common(PurpleChatConversation *chat, PurpleChatUser *cb, const char *old_name)
{
PidginConversation *gtkconv;
@@ -3569,13 +3558,10 @@
CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
-1);
- if (purple_chat_user_get_ui_data(cb)) {
- GtkTreeRowReference *ref = purple_chat_user_get_ui_data(cb);
- gtk_tree_row_reference_free(ref);
- }
-
newpath = gtk_tree_model_get_path(tm, &iter);
- purple_chat_user_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath));
+ g_object_set_data_full(G_OBJECT(cb), "pidgin-tree-row",
+ gtk_tree_row_reference_new(tm, newpath),
+ (GDestroyNotify)gtk_tree_row_reference_free);
gtk_tree_path_free(newpath);
#if 0
@@ -4763,7 +4749,7 @@
g_return_val_if_fail(cb != NULL, FALSE);
- ref = purple_chat_user_get_ui_data(cb);
+ ref = g_object_get_data(G_OBJECT(cb), "pidgin-tree-row");
if (!ref)
return FALSE;
@@ -4850,11 +4836,8 @@
return;
if (get_iter_from_chatuser(old_chatuser, &iter)) {
- GtkTreeRowReference *ref = purple_chat_user_get_ui_data(old_chatuser);
-
gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
- gtk_tree_row_reference_free(ref);
- purple_chat_user_set_ui_data(old_chatuser, NULL);
+ g_object_set_data(G_OBJECT(old_chatuser), "pidgin-tree-row", NULL);
}
g_return_if_fail(new_alias != NULL);
@@ -4939,10 +4922,8 @@
return;
if (get_iter_from_chatuser(chatuser, &iter)) {
- GtkTreeRowReference *ref = purple_chat_user_get_ui_data(chatuser);
gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
- gtk_tree_row_reference_free(ref);
- purple_chat_user_set_ui_data(chatuser, NULL);
+ g_object_set_data(G_OBJECT(chatuser), "pidgin-tree-row", NULL);
}
add_chat_user_common(chat, chatuser, NULL);
@@ -6498,9 +6479,6 @@
purple_signal_connect(purple_conversations_get_handle(), "cleared-message-history",
handle, G_CALLBACK(clear_conversation_scrollback_cb), NULL);
- purple_signal_connect(purple_conversations_get_handle(), "deleting-chat-user",
- handle, G_CALLBACK(deleting_chat_user_cb), NULL);
-
purple_conversations_set_ui_ops(&conversation_ui_ops);
hidden_convwin = pidgin_conv_window_new();