pidgin/pidgin

8dbb0f9596bb
Parents 91e5ee47f5a1
Children 60d97d8acaf0
Remove the ui-requirement property on PurplePluginInfo

This never worked right, even before gplugin. To read the value we had to have
already opened the library, which means all of its symbols were resolved. So
all this really did was stop a plugin for loading under a different UI. As we
move towards separate config directories for each UI this problem goes away.

Testing Done:
Ran and verified that plugins looked alright.

Reviewed at https://reviews.imfreedom.org/r/1462/
--- a/finch/gntplugin.c Fri May 20 15:13:02 2022 -0500
+++ b/finch/gntplugin.c Mon May 23 20:27:22 2022 -0500
@@ -143,8 +143,6 @@
var_args);
va_end(var_args);
- g_object_set(info, "ui-requirement", FINCH_UI, NULL);
-
return GPLUGIN_PLUGIN_INFO(info);
}
--- a/libpurple/purpleplugininfo.c Fri May 20 15:13:02 2022 -0500
+++ b/libpurple/purpleplugininfo.c Mon May 23 20:27:22 2022 -0500
@@ -27,7 +27,6 @@
#include "purpleplugininfo.h"
typedef struct {
- gchar *ui_requirement; /* ID of UI that is required to load the plugin */
gchar *error; /* Why a plugin is not loadable */
PurplePluginInfoFlags flags; /* Flags for the plugin */
@@ -51,7 +50,6 @@
enum {
PROP_0,
- PROP_UI_REQUIREMENT,
PROP_ACTIONS_CB,
PROP_EXTRA_CB,
PROP_PREF_FRAME_CB,
@@ -81,9 +79,6 @@
priv = purple_plugin_info_get_instance_private(info);
switch (param_id) {
- case PROP_UI_REQUIREMENT:
- priv->ui_requirement = g_value_dup_string(value);
- break;
case PROP_ACTIONS_CB:
priv->actions_cb = g_value_get_pointer(value);
break;
@@ -153,21 +148,6 @@
priv->error = g_strdup(_("This plugin has not defined an ID."));
}
- if(priv->ui_requirement != NULL) {
- PurpleUiInfo *ui_info = purple_core_get_ui_info();
- const gchar *ui_id = purple_ui_info_get_id(ui_info);
- if(!purple_strequal(priv->ui_requirement, ui_id)) {
- priv->error = g_strdup_printf(_("You are using %s, but this plugin "
- "requires %s."),
- ui_id,
- priv->ui_requirement);
- purple_debug_error("plugins",
- "%s is not loadable: The UI requirement is not "
- "met. (%s)\n",
- id, priv->error);
- }
- }
-
version = gplugin_plugin_info_get_abi_version(ginfo);
if (PURPLE_PLUGIN_ABI_MAJOR_VERSION(version) != PURPLE_MAJOR_VERSION ||
PURPLE_PLUGIN_ABI_MINOR_VERSION(version) > PURPLE_MINOR_VERSION)
@@ -193,7 +173,6 @@
priv = purple_plugin_info_get_instance_private(PURPLE_PLUGIN_INFO(object));
- g_free(priv->ui_requirement);
g_free(priv->error);
G_OBJECT_CLASS(purple_plugin_info_parent_class)->finalize(object);
@@ -209,12 +188,6 @@
obj_class->get_property = purple_plugin_info_get_property;
obj_class->set_property = purple_plugin_info_set_property;
- properties[PROP_UI_REQUIREMENT] = g_param_spec_string(
- "ui-requirement", "UI Requirement",
- "ID of UI that is required by this plugin",
- NULL,
- G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
-
properties[PROP_ACTIONS_CB] = g_param_spec_pointer(
"actions-cb", "Plugin actions",
"Callback that returns list of plugin's actions",
--- a/pidgin/pidginplugininfo.c Fri May 20 15:13:02 2022 -0500
+++ b/pidgin/pidginplugininfo.c Mon May 23 20:27:22 2022 -0500
@@ -114,7 +114,5 @@
var_args);
va_end(var_args);
- g_object_set(info, "ui-requirement", PIDGIN_UI, NULL);
-
return GPLUGIN_PLUGIN_INFO(info);
}