/soc/2013/ankitkv/gobjectification: 47a24c360401: Added purple_p...
Ankit Vani
a at nevitus.org
Sat Aug 3 12:07:43 EDT 2013
Changeset: 47a24c360401989925c2283f8e080608e645cfbf
Author: Ankit Vani <a at nevitus.org>
Date: 2013-08-03 21:37 +0530
Branch: soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/47a24c360401
Description:
Added purple_plugin_info_get_dependent_plugins() - not implemented yet, waiting for GPlugin
diffstat:
libpurple/plugins.c | 7 +++++++
libpurple/plugins.h | 9 +++++++++
pidgin/gtkplugin.c | 8 +++-----
3 files changed, 19 insertions(+), 5 deletions(-)
diffs (66 lines):
diff --git a/libpurple/plugins.c b/libpurple/plugins.c
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -499,6 +499,13 @@ purple_plugin_info_get_dependencies(cons
return gplugin_plugin_info_get_dependencies(GPLUGIN_PLUGIN_INFO(info));
}
+GSList *
+purple_plugin_info_get_dependent_plugins(const PurplePluginInfo *info)
+{
+#warning TODO: Implement this when GPlugin can return dependent plugins.
+ return NULL;
+}
+
void
purple_plugin_info_set_pref_frame_callback(PurplePluginInfo *info,
PurplePluginPrefFrameCallback callback)
diff --git a/libpurple/plugins.h b/libpurple/plugins.h
--- a/libpurple/plugins.h
+++ b/libpurple/plugins.h
@@ -347,6 +347,15 @@ gchar *purple_plugin_info_get_error(cons
GSList *purple_plugin_info_get_dependencies(const PurplePluginInfo *info);
/**
+ * Returns a list of plugins that depend on a particular plugin.
+ *
+ * @param info The plugin info of the plugin whos dependent plugins are needed.
+ *
+ * @constreturn The list of a plugins that depend on the specified plugin.
+ */
+GSList *purple_plugin_info_get_dependent_plugins(const PurplePluginInfo *info);
+
+/**
* Sets a callback to be invoked to retrieve the preferences frame for a plugin.
*
* @param info The plugin info to set the callback for.
diff --git a/pidgin/gtkplugin.c b/pidgin/gtkplugin.c
--- a/pidgin/gtkplugin.c
+++ b/pidgin/gtkplugin.c
@@ -317,15 +317,14 @@ static void plugin_toggled(GtkCellRender
if (plugin_pref_dialogs != NULL &&
(dialog = g_hash_table_lookup(plugin_pref_dialogs, plug)))
pref_dialog_response_cb(dialog, GTK_RESPONSE_DELETE_EVENT, plug);
-#warning TODO: Re-enable this section when GPlugin returns dependent plugins!
-#if 0
- if (plug->dependent_plugins != NULL)
+
+ if (purple_plugin_info_get_dependent_plugins(info) != NULL)
{
GString *tmp = g_string_new(_("The following plugins will be unloaded."));
GList *l;
gpointer *cb_data;
- for (l = plug->dependent_plugins ; l != NULL ; l = l->next)
+ for (l = purple_plugin_info_get_dependent_plugins(info); l != NULL ; l = l->next)
{
const char *dep_name = (const char *)l->data;
PurplePlugin *dep_plugin = purple_plugins_find_plugin(dep_name);
@@ -352,7 +351,6 @@ static void plugin_toggled(GtkCellRender
g_string_free(tmp, TRUE);
}
else
-#endif
plugin_toggled_stage_two(plug, model, iter, TRUE);
}
}
More information about the Commits
mailing list