/soc/2013/ankitkv/gobjectification: aee400fdb11a: Removed catego...

Ankit Vani a at nevitus.org
Sat Aug 10 17:32:35 EDT 2013


Changeset: aee400fdb11a1e766f566e4fdccf4e8c6bf286eb
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-11 03:02 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/aee400fdb11a

Description:

Removed category from purple implementation, it is now in GPlugin. Updated dependencies doc string.

diffstat:

 libpurple/plugins.c |  25 ++++++-------------------
 libpurple/plugins.h |   3 ++-
 2 files changed, 8 insertions(+), 20 deletions(-)

diffs (100 lines):

diff --git a/libpurple/plugins.c b/libpurple/plugins.c
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -36,7 +36,6 @@ typedef struct _PurplePluginInfoPrivate 
  **************************************************************************/
 struct _PurplePluginInfoPrivate {
 	guint32 purple_abi;    /**< ABI version of purple required by the plugin */
-	char *category;        /**< The category the plugin belongs to           */
 	char *ui_requirement;  /**< ID of UI that is required to load the plugin */
 	gboolean loadable;     /**< Whether the plugin is loadable               */
 	char *error;           /**< Why the plugin is not loadable               */
@@ -56,7 +55,6 @@ enum
 {
 	PROP_0,
 	PROP_PURPLE_ABI,
-	PROP_CATEGORY,
 	PROP_UI_REQUIREMENT,
 	PROP_GET_ACTIONS,
 	PROP_PREFERENCES_FRAME,
@@ -315,7 +313,6 @@ purple_plugin_get_dependent_plugins(cons
  **************************************************************************/
 /* GObject Property names */
 #define PROP_PURPLE_ABI_S         "purple-abi"
-#define PROP_CATEGORY_S           "category"
 #define PROP_UI_REQUIREMENT_S     "ui-requirement"
 #define PROP_GET_ACTIONS_S        "get-actions"
 #define PROP_PREFERENCES_FRAME_S  "preferences-frame"
@@ -332,9 +329,6 @@ purple_plugin_info_set_property(GObject 
 		case PROP_PURPLE_ABI:
 			priv->purple_abi = g_value_get_uint(value);
 			break;
-		case PROP_CATEGORY:
-			priv->category = g_strdup(g_value_get_string(value));
-			break;
 		case PROP_UI_REQUIREMENT:
 			priv->ui_requirement = g_strdup(g_value_get_string(value));
 			break;
@@ -361,9 +355,6 @@ purple_plugin_info_get_property(GObject 
 		case PROP_PURPLE_ABI:
 			g_value_set_uint(value, purple_plugin_info_get_abi_version(info));
 			break;
-		case PROP_CATEGORY:
-			g_value_set_string(value, purple_plugin_info_get_category(info));
-			break;
 		case PROP_GET_ACTIONS:
 			g_value_set_pointer(value,
 					purple_plugin_info_get_actions_callback(info));
@@ -430,7 +421,6 @@ purple_plugin_info_finalize(GObject *obj
 {
 	PurplePluginInfoPrivate *priv = PURPLE_PLUGIN_INFO_GET_PRIVATE(object);
 
-	g_free(priv->category);
 	g_free(priv->ui_requirement);
 	g_free(priv->error);
 
@@ -460,12 +450,6 @@ static void purple_plugin_info_class_ini
 		                  0, G_MAXUINT32, 0,
 		                  G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
-	g_object_class_install_property(obj_class, PROP_CATEGORY,
-		g_param_spec_string(PROP_CATEGORY_S,
-		                  "Category",
-		                  "The category that the plugin belongs to", NULL,
-		                  G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
 	g_object_class_install_property(obj_class, PROP_UI_REQUIREMENT,
 		g_param_spec_string(PROP_UI_REQUIREMENT_S,
 		                  "UI Requirement",
@@ -572,11 +556,14 @@ purple_plugin_info_get_version(const Pur
 const gchar *
 purple_plugin_info_get_category(const PurplePluginInfo *info)
 {
-	PurplePluginInfoPrivate *priv = PURPLE_PLUGIN_INFO_GET_PRIVATE(info);
+#ifdef PURPLE_PLUGINS
+	g_return_val_if_fail(info != NULL, NULL);
 
-	g_return_val_if_fail(priv != NULL, NULL);
+	return gplugin_plugin_info_get_category(GPLUGIN_PLUGIN_INFO(info));
 
-	return priv->category;
+#else
+	return NULL;
+#endif
 }
 
 const gchar *
diff --git a/libpurple/plugins.h b/libpurple/plugins.h
--- a/libpurple/plugins.h
+++ b/libpurple/plugins.h
@@ -376,8 +376,9 @@ GType purple_plugin_info_get_type(void);
  *                               unlisted on SPDX.                           \n
  * "license-url"        (string) The plugin's license URL, if unlisted on
  *                               SPDX.                                       \n
+ * "dependencies"       (string) Comma-seperated list of plugin IDs required
+ *                               by the plugin.                              \n
  * "purple-abi"         (guint32) The purple ABI version required by plugin. \n
- * "dependencies"       (GSList) List of plugin IDs required by the plugin.  \n
  * "get-actions"        (PurplePluginGetActionsCallback) Callback that
  *                               returns a list of actions the plugin can
  *                               perform.                                    \n



More information about the Commits mailing list