/pidgin/main: 32611080681c: Cleanup the plugin pref stuff so it ...
Gary Kramlich
grim at reaperworld.com
Tue Feb 16 23:35:48 EST 2016
Changeset: 32611080681c67ce7e1d9b2122eafbbbe0aca666
Author: Gary Kramlich <grim at reaperworld.com>
Date: 2016-02-16 18:37 -0600
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/32611080681c
Description:
Cleanup the plugin pref stuff so it works and doesn't crash
diffstat:
pidgin/gtkplugin.c | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diffs (43 lines):
diff --git a/pidgin/gtkplugin.c b/pidgin/gtkplugin.c
--- a/pidgin/gtkplugin.c
+++ b/pidgin/gtkplugin.c
@@ -205,28 +205,23 @@ pidgin_plugin_get_config_frame(PurplePlu
{
GtkWidget *config = NULL;
PurplePluginInfo *info;
- PidginPluginInfoPrivate *priv = NULL;
+ PurplePluginPrefFrameCb pref_frame_cb = NULL;
- g_return_val_if_fail(plugin != NULL, NULL);
+ g_return_val_if_fail(PURPLE_IS_PLUGIN(plugin), NULL);
info = purple_plugin_get_info(plugin);
- if (PIDGIN_IS_PLUGIN_INFO(info))
- priv = PIDGIN_PLUGIN_INFO_GET_PRIVATE(info);
+ if(!PURPLE_IS_PLUGIN_INFO(info))
+ return NULL;
- if (priv)
- config = priv->config_frame_cb(plugin);
+ pref_frame_cb = purple_plugin_info_get_pref_frame_cb(info);
+ if(pref_frame_cb) {
+ PurplePluginPrefFrame *frame = pref_frame_cb(plugin);
- if (!config && purple_plugin_info_get_pref_frame_cb(info))
- {
- PurplePluginPrefFrame *frame;
- PurplePluginPrefFrameCb pref_frame_cb =
- purple_plugin_info_get_pref_frame_cb(info);
+ if(frame) {
+ config = pidgin_plugin_pref_create_frame(frame);
- frame = pref_frame_cb(plugin);
-
- config = pidgin_plugin_pref_create_frame(frame);
-
- *purple_pref_frame = frame;
+ *purple_pref_frame = frame;
+ }
}
return config;
More information about the Commits
mailing list