Remove PurpleProtocolAction as it has been replaced by PurpleProtocolActions
Testing Done:
Called in the turtles.
Reviewed at https://reviews.imfreedom.org/r/3160/
--- a/libpurple/action.c Mon May 06 00:11:54 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-struct _PurpleActionMenu {
-/******************************************************************************
- *****************************************************************************/
-purple_action_menu_new(const gchar *label, GCallback callback, gpointer data,
- PurpleActionMenu *act = g_new(PurpleActionMenu, 1);
- act->label = g_strdup(label);
- act->callback = callback;
- act->children = children;
-purple_action_menu_free(PurpleActionMenu *act) {
- g_return_if_fail(act != NULL);
- purple_action_menu_set_children(act, NULL);
-purple_action_menu_get_label(const PurpleActionMenu *act) {
- g_return_val_if_fail(act != NULL, NULL);
-purple_action_menu_get_callback(const PurpleActionMenu *act) {
- g_return_val_if_fail(act != NULL, NULL);
-purple_action_menu_get_data(const PurpleActionMenu *act) {
- g_return_val_if_fail(act != NULL, NULL);
-purple_action_menu_get_children(const PurpleActionMenu *act) {
- g_return_val_if_fail(act != NULL, NULL);
-purple_action_menu_set_label(PurpleActionMenu *act, const gchar *label) {
- g_return_if_fail(act != NULL);
- act->label = g_strdup(label);
-purple_action_menu_set_callback(PurpleActionMenu *act, GCallback callback) {
- g_return_if_fail(act != NULL);
- act->callback = callback;
-purple_action_menu_set_data(PurpleActionMenu *act, gpointer data) {
- g_return_if_fail(act != NULL);
-purple_action_menu_set_children(PurpleActionMenu *act, GList *children) {
- g_return_if_fail(act != NULL);
- g_list_free_full(act->children, (GDestroyNotify)purple_action_menu_free);
- act->children = children;
-/******************************************************************************
- *****************************************************************************/
-purple_protocol_action_new(const gchar* label, PurpleProtocolActionCallback callback) {
- PurpleProtocolAction *action;
- g_return_val_if_fail(label != NULL, NULL);
- g_return_val_if_fail(callback != NULL, NULL);
- action = g_new0(PurpleProtocolAction, 1);
- action->label = g_strdup(label);
- action->callback = callback;
-purple_protocol_action_free(PurpleProtocolAction *action) {
- g_return_if_fail(action != NULL);
-purple_protocol_action_copy(PurpleProtocolAction *action) {
- g_return_val_if_fail(action != NULL, NULL);
- return purple_protocol_action_new(action->label, action->callback);
- purple_protocol_action,
- purple_protocol_action_copy,
- purple_protocol_action_free
--- a/libpurple/action.h Mon May 06 00:11:54 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +0,0 @@
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#include <glib-object.h>
-#include "purpleversion.h"
-#define PURPLE_TYPE_PROTOCOL_ACTION (purple_protocol_action_get_type())
-PURPLE_AVAILABLE_TYPE_IN_3_0
-typedef struct _PurpleProtocolAction PurpleProtocolAction;
- * PurpleProtocolActionCallback:
- * @action: The action that was activated.
- * The callback function for [type@ProtocolAction].
-PURPLE_AVAILABLE_TYPE_IN_3_0
-typedef void (*PurpleProtocolActionCallback)(PurpleProtocolAction *action);
- * A generic structure that contains information about an "action". One
- * place this is used is by protocols to tell the core the list of available
- * right-click actions for a buddy list row.
-PURPLE_AVAILABLE_TYPE_IN_3_0
-typedef struct _PurpleActionMenu PurpleActionMenu;
- * PurpleProtocolAction:
- * @label: A translated string to be shown in a user interface.
- * @callback: The function to call when the user wants to perform this action.
- * @connection: The connection that this action should be performed against.
- * @user_data: User data to pass to @callback.
- * Represents an action that the protocol can perform. This shows up in the
- * Accounts menu, under a submenu with the name of the account.
-struct _PurpleProtocolAction {
- PurpleProtocolActionCallback callback;
- PurpleConnection *connection;
-/******************************************************************************
- *****************************************************************************/
- * purple_action_menu_new:
- * @label: The text label to display for this action.
- * @callback: (scope notified): The function to be called when the action is used on
- * @data: Additional data to be passed to the callback.
- * @children: (element-type PurpleActionMenu) (transfer full): Menu actions to
- * be added as a submenu of this action.
- * Creates a new PurpleActionMenu.
- * Returns: (transfer full): The PurpleActionMenu.
-PurpleActionMenu *purple_action_menu_new(const gchar *label, GCallback callback, gpointer data, GList *children);
- * purple_action_menu_free:
- * @act: The PurpleActionMenu to free.
- * Frees a PurpleActionMenu
-void purple_action_menu_free(PurpleActionMenu *act);
- * purple_action_menu_get_label:
- * @act: The PurpleActionMenu.
- * Returns the label of the PurpleActionMenu.
- * Returns: The label string.
-const gchar *purple_action_menu_get_label(const PurpleActionMenu *act);
- * purple_action_menu_get_callback:
- * @act: The PurpleActionMenu.
- * Returns the callback of the PurpleActionMenu.
- * Returns: (transfer none): The callback function.
-GCallback purple_action_menu_get_callback(const PurpleActionMenu *act);
- * purple_action_menu_get_data:
- * @act: The PurpleActionMenu.
- * Returns the data stored in the PurpleActionMenu.
-gpointer purple_action_menu_get_data(const PurpleActionMenu *act);
- * purple_action_menu_get_children:
- * @act: The PurpleActionMenu.
- * Returns the children of the PurpleActionMenu.
- * Returns: (element-type PurpleActionMenu) (transfer none): The menu children.
-GList* purple_action_menu_get_children(const PurpleActionMenu *act);
- * purple_action_menu_set_label:
- * @act: The menu action.
- * @label: The label for the menu action.
- * Set the label to the PurpleActionMenu.
-void purple_action_menu_set_label(PurpleActionMenu *act, const gchar *label);
- * purple_action_menu_set_callback:
- * @act: The menu action.
- * @callback: (scope notified): The callback.
- * Set the callback that will be used by the PurpleActionMenu.
-void purple_action_menu_set_callback(PurpleActionMenu *act, GCallback callback);
- * purple_action_menu_set_data:
- * @act: The menu action.
- * @data: The data used by this PurpleActionMenu
- * Set the label to the PurpleActionMenu.
-void purple_action_menu_set_data(PurpleActionMenu *act, gpointer data);
- * purple_action_menu_set_children:
- * @act: The menu action.
- * @children: (element-type PurpleActionMenu) (transfer full): The menu children
- * Set the children of the PurpleActionMenu.
-void purple_action_menu_set_children(PurpleActionMenu *act, GList *children);
-/******************************************************************************
- *****************************************************************************/
- * purple_protocol_action_get_type:
- * Returns: The #GType for the #PurpleProtocolAction boxed structure.
-GType purple_protocol_action_get_type(void);
- * purple_protocol_action_new:
- * @label: The description of the action to show to the user.
- * @callback: (scope call): The callback to call when the user selects this
- * Allocates and returns a new PurpleProtocolAction. Use this to add actions in
- * a list in the get_actions function of the protocol.
- * Returns: (transfer full): The new #PurpleProtocolAction.
-PurpleProtocolAction *purple_protocol_action_new(const gchar *label, PurpleProtocolActionCallback callback);
- * purple_protocol_action_copy:
- * @action: The #PurpleProtocolAction to copy.
- * Creates a newly allocated copy of @action.
- * Returns: (transfer full): A copy of @action.
-PurpleProtocolAction *purple_protocol_action_copy(PurpleProtocolAction *action);
- * purple_protocol_action_free:
- * @action: The PurpleProtocolAction to free.
- * Frees a PurpleProtocolAction
-void purple_protocol_action_free(PurpleProtocolAction *action);
-#endif /* PURPLE_ACTION_H */
--- a/libpurple/meson.build Mon May 06 00:11:54 2024 -0500
+++ b/libpurple/meson.build Mon May 06 22:23:21 2024 -0500
@@ -1,6 +1,5 @@
@@ -98,7 +97,6 @@
--- a/libpurple/tests/meson.build Mon May 06 00:11:54 2024 -0500
+++ b/libpurple/tests/meson.build Mon May 06 22:23:21 2024 -0500
@@ -30,7 +30,6 @@
'protocol_file_transfer',
--- a/libpurple/tests/test_protocol_action.c Mon May 06 00:11:54 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
- * Purple is the legal property of its developers, whose names are too
- * numerous to list here. Please refer to the COPYRIGHT file distributed
- * with this source distribution
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-/******************************************************************************
- *****************************************************************************/
-_test_purple_protocol_action_callback(G_GNUC_UNUSED PurpleProtocolAction *action) {
-/******************************************************************************
- *****************************************************************************/
-test_purple_protocol_action_new(void) {
- PurpleProtocolAction *action = NULL;
- action = purple_protocol_action_new(
- _test_purple_protocol_action_callback
- g_assert_nonnull(action);
- g_assert_cmpstr(action->label, ==, "label");
- g_assert(action->callback == _test_purple_protocol_action_callback);
- purple_protocol_action_free(action);
-test_purple_protocol_action_copy(void) {
- PurpleProtocolAction *orig = NULL, *copy = NULL;
- orig = purple_protocol_action_new(
- _test_purple_protocol_action_callback
- g_assert_nonnull(orig);
- copy = purple_protocol_action_copy(orig);
- purple_protocol_action_free(orig);
- g_assert_cmpstr(copy->label, ==, "label");
- g_assert(copy->callback == _test_purple_protocol_action_callback);
- purple_protocol_action_free(copy);
-/******************************************************************************
- *****************************************************************************/
-main(gint argc, gchar **argv) {
- g_test_init(&argc, &argv, NULL);
- g_test_set_nonfatal_assertions();
- "/protocol-action/new",
- test_purple_protocol_action_new
- "/protocol-action/copy",
- test_purple_protocol_action_copy
--- a/po/POTFILES.in Mon May 06 00:11:54 2024 -0500
+++ b/po/POTFILES.in Mon May 06 22:23:21 2024 -0500
@@ -1,5 +1,4 @@
libpurple/circularbuffer.c
@@ -89,7 +88,6 @@
libpurple/tests/test_image.c
libpurple/tests/test_keyvaluepair.c
libpurple/tests/test_markup.c
-libpurple/tests/test_protocol_action.c
libpurple/tests/test_purplepath.c
libpurple/tests/test_ui.c
libpurple/tests/test_util.c