pidgin/pidgin

bcfc2c9e5213
Parents affc85fd4f3a
Children aefc93bef426
Move all of the UiOps to use struct initializers

Testing Done:
Compiled

Reviewed at https://reviews.imfreedom.org/r/1814/
--- a/finch/gntconv.c Tue Sep 20 02:43:20 2022 -0500
+++ b/finch/gntconv.c Tue Sep 20 02:44:44 2022 -0500
@@ -1069,24 +1069,16 @@
return FALSE;
}
-static PurpleConversationUiOps conv_ui_ops =
-{
- finch_create_conversation,
- finch_destroy_conversation,
- NULL, /* write_chat */
- NULL, /* write_im */
- finch_write_conv,
- finch_chat_add_users,
- finch_chat_rename_user,
- finch_chat_remove_users,
- finch_chat_update_user,
- finch_conv_present, /* present */
- finch_conv_has_focus, /* has_focus */
- NULL, /* send_confirm */
- NULL,
- NULL,
- NULL,
- NULL
+static PurpleConversationUiOps conv_ui_ops = {
+ .create_conversation = finch_create_conversation,
+ .destroy_conversation = finch_destroy_conversation,
+ .write_conv = finch_write_conv,
+ .chat_add_users = finch_chat_add_users,
+ .chat_rename_user = finch_chat_rename_user,
+ .chat_remove_users = finch_chat_remove_users,
+ .chat_update_user = finch_chat_update_user,
+ .present = finch_conv_present,
+ .has_focus = finch_conv_has_focus,
};
PurpleConversationUiOps *finch_conv_get_ui_ops()
--- a/finch/gntnotify.c Tue Sep 20 02:43:20 2022 -0500
+++ b/finch/gntnotify.c Tue Sep 20 02:44:44 2022 -0500
@@ -396,21 +396,14 @@
_("URI"), url, NULL, NULL);
}
-static PurpleNotifyUiOps ops =
-{
- finch_notify_message,
- finch_notify_formatted,
- finch_notify_searchresults,
- finch_notify_sr_new_rows,
- finch_notify_userinfo,
- finch_notify_uri,
- finch_close_notify, /* The rest of the notify-uiops return a GntWidget.
- These widgets should be destroyed from here. */
- NULL,
- NULL,
- NULL,
- NULL
-
+static PurpleNotifyUiOps ops = {
+ .notify_message = finch_notify_message,
+ .notify_formatted = finch_notify_formatted,
+ .notify_searchresults = finch_notify_searchresults,
+ .notify_searchresults_new_rows = finch_notify_sr_new_rows,
+ .notify_userinfo = finch_notify_userinfo,
+ .notify_uri = finch_notify_uri,
+ .close_notify = finch_close_notify,
};
PurpleNotifyUiOps *finch_notify_get_ui_ops()
--- a/finch/gntrequest.c Tue Sep 20 02:43:20 2022 -0500
+++ b/finch/gntrequest.c Tue Sep 20 02:44:44 2022 -0500
@@ -811,22 +811,14 @@
return data->dialog;
}
-static PurpleRequestUiOps uiops =
-{
- 0,
- finch_request_input,
- finch_request_choice,
- finch_request_action,
- NULL,
- NULL,
- finch_request_fields,
- finch_request_file,
- finch_request_folder,
- finch_close_request,
- NULL,
- NULL,
- NULL,
- NULL
+static PurpleRequestUiOps uiops = {
+ .request_input = finch_request_input,
+ .request_choice = finch_request_choice,
+ .request_action = finch_request_action,
+ .request_fields = finch_request_fields,
+ .request_file = finch_request_file,
+ .request_folder = finch_request_folder,
+ .close_request = finch_close_request,
};
PurpleRequestUiOps *finch_request_get_ui_ops()
--- a/finch/gntroomlist.c Tue Sep 20 02:43:20 2022 -0500
+++ b/finch/gntroomlist.c Tue Sep 20 02:44:44 2022 -0500
@@ -308,17 +308,11 @@
gnt_tree_set_expanded(GNT_TREE(froomlist.tree), room, category == NULL);
}
-static PurpleRoomlistUiOps ui_ops =
-{
- fl_show_with_account, /* void (*show_with_account)(PurpleAccount *account); **< Force the ui to pop up a dialog and get the list */
- fl_create, /* void (*create)(PurpleRoomlist *list); **< A new list was created. */
- fl_set_fields, /* void (*set_fields)(PurpleRoomlist *list, GList *fields); **< Sets the columns. */
- fl_add_room, /* void (*add_room)(PurpleRoomlist *list, PurpleRoomlistRoom *room); **< Add a room to the list. */
-
- NULL, /* void (*_purple_reserved1)(void); */
- NULL, /* void (*_purple_reserved2)(void); */
- NULL, /* void (*_purple_reserved3)(void); */
- NULL /* void (*_purple_reserved4)(void); */
+static PurpleRoomlistUiOps ui_ops = {
+ .show_with_account = fl_show_with_account,
+ .create = fl_create,
+ .set_fields = fl_set_fields,
+ .add_room = fl_add_room,
};
PurpleRoomlistUiOps *finch_roomlist_get_ui_ops(void)
--- a/finch/gntxfer.c Tue Sep 20 02:43:20 2022 -0500
+++ b/finch/gntxfer.c Tue Sep 20 02:44:44 2022 -0500
@@ -496,9 +496,8 @@
G_CALLBACK(finch_xfer_visible_notify), NULL);
}
-static PurpleXferUiOps ops =
-{
- finch_xfer_new_xfer
+static PurpleXferUiOps ops = {
+ .new_xfer = finch_xfer_new_xfer
};
/**************************************************************************
--- a/pidgin/gtknotify.c Tue Sep 20 02:43:20 2022 -0500
+++ b/pidgin/gtknotify.c Tue Sep 20 02:44:44 2022 -0500
@@ -627,19 +627,14 @@
purple_signals_disconnect_by_handle(pidgin_notify_get_handle());
}
-static PurpleNotifyUiOps ops =
-{
- pidgin_notify_message,
- pidgin_notify_formatted,
- pidgin_notify_searchresults,
- pidgin_notify_searchresults_new_rows,
- pidgin_notify_userinfo,
- pidgin_notify_uri,
- pidgin_close_notify,
- NULL,
- NULL,
- NULL,
- NULL
+static PurpleNotifyUiOps ops = {
+ .notify_message = pidgin_notify_message,
+ .notify_formatted = pidgin_notify_formatted,
+ .notify_searchresults = pidgin_notify_searchresults,
+ .notify_searchresults_new_rows = pidgin_notify_searchresults_new_rows,
+ .notify_userinfo = pidgin_notify_userinfo,
+ .notify_uri = pidgin_notify_uri,
+ .close_notify = pidgin_close_notify,
};
PurpleNotifyUiOps *
--- a/pidgin/gtkrequest.c Tue Sep 20 02:43:20 2022 -0500
+++ b/pidgin/gtkrequest.c Tue Sep 20 02:44:44 2022 -0500
@@ -2458,22 +2458,17 @@
return GTK_WINDOW(data->dialog);
}
-static PurpleRequestUiOps ops =
-{
- PURPLE_REQUEST_FEATURE_HTML,
- pidgin_request_input,
- pidgin_request_choice,
- pidgin_request_action,
- pidgin_request_wait,
- pidgin_request_wait_update,
- pidgin_request_fields,
- pidgin_request_file,
- pidgin_request_folder,
- pidgin_close_request,
- NULL,
- NULL,
- NULL,
- NULL
+static PurpleRequestUiOps ops = {
+ .features = PURPLE_REQUEST_FEATURE_HTML,
+ .request_input = pidgin_request_input,
+ .request_choice = pidgin_request_choice,
+ .request_action = pidgin_request_action,
+ .request_wait = pidgin_request_wait,
+ .request_wait_update = pidgin_request_wait_update,
+ .request_fields = pidgin_request_fields,
+ .request_file = pidgin_request_file,
+ .request_folder = pidgin_request_folder,
+ .close_request = pidgin_close_request,
};
PurpleRequestUiOps *
--- a/pidgin/gtkroomlist.c Tue Sep 20 02:43:20 2022 -0500
+++ b/pidgin/gtkroomlist.c Tue Sep 20 02:44:44 2022 -0500
@@ -658,14 +658,9 @@
}
static PurpleRoomlistUiOps ops = {
- pidgin_roomlist_dialog_show_with_account,
- pidgin_roomlist_new,
- NULL,
- pidgin_roomlist_add_room,
- NULL,
- NULL,
- NULL,
- NULL
+ .show_with_account = pidgin_roomlist_dialog_show_with_account,
+ .create = pidgin_roomlist_new,
+ .add_room = pidgin_roomlist_add_room,
};
--- a/pidgin/gtkwhiteboard.c Tue Sep 20 02:43:20 2022 -0500
+++ b/pidgin/gtkwhiteboard.c Tue Sep 20 02:44:44 2022 -0500
@@ -587,15 +587,14 @@
/******************************************************************************
* API
*****************************************************************************/
-static PurpleWhiteboardUiOps ui_ops =
-{
- pidgin_whiteboard_create,
- pidgin_whiteboard_destroy,
- pidgin_whiteboard_set_dimensions,
- pidgin_whiteboard_set_brush,
- pidgin_whiteboard_draw_brush_point,
- pidgin_whiteboard_draw_brush_line,
- pidgin_whiteboard_clear,
+static PurpleWhiteboardUiOps ui_ops = {
+ .create = pidgin_whiteboard_create,
+ .destroy = pidgin_whiteboard_destroy,
+ .set_dimensions = pidgin_whiteboard_set_dimensions,
+ .set_brush = pidgin_whiteboard_set_brush,
+ .draw_point = pidgin_whiteboard_draw_brush_point,
+ .draw_line = pidgin_whiteboard_draw_brush_line,
+ .clear = pidgin_whiteboard_clear,
};
PurpleWhiteboardUiOps *
--- a/pidgin/gtkxfer.c Tue Sep 20 02:43:20 2022 -0500
+++ b/pidgin/gtkxfer.c Tue Sep 20 02:44:44 2022 -0500
@@ -921,9 +921,8 @@
G_CALLBACK(pidgin_xfer_visible_notify), NULL);
}
-static PurpleXferUiOps ops =
-{
- pidgin_xfer_new_xfer
+static PurpleXferUiOps ops = {
+ .new_xfer = pidgin_xfer_new_xfer
};
/**************************************************************************