diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2021-07-02 04:32:18 -0500 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2021-07-02 04:32:18 -0500 |
commit | 65a9657609f4553d9d52012bbe52033fb160fd7a (patch) | |
tree | e2d4241e779714226aabe4ecdaa8659e84529a60 /libpurple/roomlist.c | |
parent | 677d691dae0c1b6d368d093c22aeff6785f0549d (diff) | |
download | pidgin-65a9657609f4553d9d52012bbe52033fb160fd7a.tar.gz |
Cleanup RoomList UI ops
* Mark unused parameters, and remove unnecessary widgets passed to callbacks.
* Remove unused `purple_roomlist_[gs]et_protocol_data`.
* Remove unused list of `PurpleRoomList`s.
* Inline `update_roomlist` using GObject macros.
* Remove use of `PurpleRoomListUiOps->destroy`.
This can be achieved through object destruction notifiers.
I'm not sure how the room list would ever get destroyed in Finch though, as the
widget seems to hold a ref to it, which is cleared when the list is destroyed.
But the list can't be destroyed until said ref is dropped.
* Replace `PurpleRoomlistUiOps->in_progress` with notify signals.
Testing Done:
Compile only. Might have done some tests, but I wrote this a while back and don't remember.
Reviewed at https://reviews.imfreedom.org/r/785/
Diffstat (limited to 'libpurple/roomlist.c')
-rw-r--r-- | libpurple/roomlist.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/libpurple/roomlist.c b/libpurple/roomlist.c index 7b950d7d3a..6b3d36a2e0 100644 --- a/libpurple/roomlist.c +++ b/libpurple/roomlist.c @@ -28,20 +28,15 @@ #include "roomlist.h" #include "server.h" -typedef struct _PurpleRoomlistPrivate PurpleRoomlistPrivate; - /* * Private data for a room list. */ -struct _PurpleRoomlistPrivate { +typedef struct { PurpleAccount *account; /* The account this list belongs to. */ GList *fields; /* The fields. */ GList *rooms; /* The list of rooms. */ gboolean in_progress; /* The listing is in progress. */ - - /* TODO Remove this and use protocol-specific subclasses. */ - gpointer proto_data; /* Protocol private data. */ -}; +} PurpleRoomlistPrivate; /* * Represents a room. @@ -127,9 +122,6 @@ void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress) priv = purple_roomlist_get_instance_private(list); priv->in_progress = in_progress; - if (ops && ops->in_progress) - ops->in_progress(list, in_progress); - g_object_notify_by_pspec(G_OBJECT(list), properties[PROP_IN_PROGRESS]); } @@ -224,26 +216,6 @@ GList * purple_roomlist_get_fields(PurpleRoomlist *list) return priv->fields; } -gpointer purple_roomlist_get_protocol_data(PurpleRoomlist *list) -{ - PurpleRoomlistPrivate *priv = NULL; - - g_return_val_if_fail(PURPLE_IS_ROOMLIST(list), NULL); - - priv = purple_roomlist_get_instance_private(list); - return priv->proto_data; -} - -void purple_roomlist_set_protocol_data(PurpleRoomlist *list, gpointer proto_data) -{ - PurpleRoomlistPrivate *priv = NULL; - - g_return_if_fail(PURPLE_IS_ROOMLIST(list)); - - priv = purple_roomlist_get_instance_private(list); - priv->proto_data = proto_data; -} - /**************************************************************************/ /* Room List GObject code */ /**************************************************************************/ @@ -324,9 +296,6 @@ purple_roomlist_finalize(GObject *object) purple_debug_misc("roomlist", "destroying list %p\n", list); - if (ops && ops->destroy) - ops->destroy(list); - for (l = priv->rooms; l; l = l->next) { PurpleRoomlistRoom *r = l->data; purple_roomlist_room_destroy(list, r); |