/soc/2013/ankitkv/gobjectification: fbddfc86848d: Renamed purple...

Ankit Vani a at nevitus.org
Fri Aug 9 21:50:12 EDT 2013


Changeset: fbddfc86848dcc837c5f70b78ecca54119e2a14d
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-10 04:59 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/fbddfc86848d

Description:

Renamed purple-version to purple-abi. Removed abi-version from docs

diffstat:

 libpurple/plugins.c                 |  37 ++++++++++++++++++-------------------
 libpurple/plugins.h                 |   7 +++----
 libpurple/protocols/null/nullprpl.c |  21 ++++++++++-----------
 3 files changed, 31 insertions(+), 34 deletions(-)

diffs (166 lines):

diff --git a/libpurple/plugins.c b/libpurple/plugins.c
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -35,12 +35,12 @@ typedef struct _PurplePluginInfoPrivate 
  * Plugin info private data
  **************************************************************************/
 struct _PurplePluginInfoPrivate {
-	guint32 purple_version; /**< The 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 */
-	GList *actions;         /**< Actions that the plugin can perform          */
-	gboolean loadable;      /**< Whether the plugin is loadable               */
-	char *error;            /**< Why the plugin is not loadable               */
+	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 */
+	GList *actions;        /**< Actions that the plugin can perform          */
+	gboolean loadable;     /**< Whether the plugin is loadable               */
+	char *error;           /**< Why the plugin is not loadable               */
 
 	/** Callback that returns a preferences frame for a plugin */
 	PurplePluginPrefFrameCallback get_pref_frame;
@@ -53,7 +53,7 @@ struct _PurplePluginInfoPrivate {
 enum
 {
 	PROP_0,
-	PROP_PURPLE_VERSION,
+	PROP_PURPLE_ABI,
 	PROP_CATEGORY,
 	PROP_UI_REQUIREMENT,
 	PROP_PREFERENCES_FRAME,
@@ -351,7 +351,7 @@ purple_plugin_get_dependent_plugins(cons
  * GObject code for PurplePluginInfo
  **************************************************************************/
 /* GObject Property names */
-#define PROP_PURPLE_VERSION_S     "purple-version"
+#define PROP_PURPLE_ABI_S         "purple-abi"
 #define PROP_CATEGORY_S           "category"
 #define PROP_UI_REQUIREMENT_S     "ui-requirement"
 #define PROP_PREFERENCES_FRAME_S  "preferences-frame"
@@ -365,8 +365,8 @@ purple_plugin_info_set_property(GObject 
 	PurplePluginInfoPrivate *priv = PURPLE_PLUGIN_INFO_GET_PRIVATE(info);
 
 	switch (param_id) {
-		case PROP_PURPLE_VERSION:
-			priv->purple_version = g_value_get_uint(value);
+		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));
@@ -391,9 +391,8 @@ purple_plugin_info_get_property(GObject 
 	PurplePluginInfo *info = PURPLE_PLUGIN_INFO(obj);
 
 	switch (param_id) {
-		case PROP_PURPLE_VERSION:
-			g_value_set_uint(value,
-					purple_plugin_info_get_purple_version(info));
+		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));
@@ -438,7 +437,7 @@ purple_plugin_info_constructed(GObject *
 		priv->loadable = FALSE;
 	}
 
-	version = purple_plugin_info_get_purple_version(info);
+	version = purple_plugin_info_get_abi_version(info);
 	if (PURPLE_PLUGIN_ABI_MAJOR_VERSION(version) != PURPLE_MAJOR_VERSION ||
 		PURPLE_PLUGIN_ABI_MINOR_VERSION(version) > PURPLE_MINOR_VERSION)
 	{
@@ -488,9 +487,9 @@ static void purple_plugin_info_class_ini
 	obj_class->get_property = purple_plugin_info_get_property;
 	obj_class->set_property = purple_plugin_info_set_property;
 
-	g_object_class_install_property(obj_class, PROP_PURPLE_VERSION,
-		g_param_spec_uint(PROP_PURPLE_VERSION_S,
-		                  "Purple version",
+	g_object_class_install_property(obj_class, PROP_PURPLE_ABI,
+		g_param_spec_uint(PROP_PURPLE_ABI_S,
+		                  "ABI version",
 		                  "The libpurple ABI version required by the plugin",
 		                  0, G_MAXUINT32, 0,
 		                  G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
@@ -713,13 +712,13 @@ purple_plugin_info_get_license_url(const
 }
 
 guint32
-purple_plugin_info_get_purple_version(const PurplePluginInfo *info)
+purple_plugin_info_get_abi_version(const PurplePluginInfo *info)
 {
 	PurplePluginInfoPrivate *priv = PURPLE_PLUGIN_INFO_GET_PRIVATE(info);
 
 	g_return_val_if_fail(priv != NULL, 0);
 
-	return priv->purple_version;
+	return priv->purple_abi;
 }
 
 GSList *
diff --git a/libpurple/plugins.h b/libpurple/plugins.h
--- a/libpurple/plugins.h
+++ b/libpurple/plugins.h
@@ -369,7 +369,7 @@ GType purple_plugin_info_get_type(void);
  * Creates a new #PurplePluginInfo instance to be returned from
  * gplugin_plugin_query() of a plugin, using the provided name/value pairs.
  *
- * All properties except "id", "purple-version", and "abi-version" are optional.
+ * All properties except "id" and "purple-abi" are optional.
  *
  * Valid property names are:                                                 \n
  * "id"                 (string) The ID of the plugin.                       
@@ -391,8 +391,7 @@ GType purple_plugin_info_get_type(void);
  *                               unlisted on SPDX.                           \n
  * "license-url"        (string) The plugin's license URL, if unlisted on
  *                               SPDX.                                       \n
- * "purple-version"     (guint32) The purple ABI version required by plugin. \n
- * "abi-version"        (guint32) The GPlugin ABI version of 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
  * "preferences-frame"  (PurplePluginPrefFrameCallback) Callback that returns
  *                                        a preferences frame for the plugin.
@@ -529,7 +528,7 @@ const gchar *purple_plugin_info_get_lice
  *
  * @return The required purple ABI version for the plugin.
  */
-guint32 purple_plugin_info_get_purple_version(const PurplePluginInfo *info);
+guint32 purple_plugin_info_get_abi_version(const PurplePluginInfo *info);
 
 /**
  * Returns a list of plugins that a particular plugin depends on.
diff --git a/libpurple/protocols/null/nullprpl.c b/libpurple/protocols/null/nullprpl.c
--- a/libpurple/protocols/null/nullprpl.c
+++ b/libpurple/protocols/null/nullprpl.c
@@ -1138,20 +1138,19 @@ static PurplePluginInfo *
 plugin_query(void)
 {
   return purple_plugin_info_new(
-    "id",              NULLPRPL_ID,
-    "name",            "Null - Testing Plugin",
-    "version",         DISPLAY_VERSION,
-    "category",        N_("Protocol"),
-    "summary",         N_("Null Protocol Plugin"),
-    "description",     N_("Null Protocol Plugin"),
-    "website",         PURPLE_WEBSITE,
-    "purple-version",  PURPLE_ABI_VERSION,
-    "abi-version",     GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
+    "id",           NULLPRPL_ID,
+    "name",         "Null - Testing Plugin",
+    "version",      DISPLAY_VERSION,
+    "category",     N_("Protocol"),
+    "summary",      N_("Null Protocol Plugin"),
+    "description",  N_("Null Protocol Plugin"),
+    "website",      PURPLE_WEBSITE,
+    "purple-abi",   PURPLE_ABI_VERSION,
 
     /* If you're using this as the basis of a protocol plugin that will be
      * distributed separately from libpurple, do not include these flags.*/
-    "flags",           GPLUGIN_PLUGIN_INFO_FLAGS_INTERNAL |
-                       GPLUGIN_PLUGIN_INFO_FLAGS_LOAD_ON_QUERY,
+    "flags",        GPLUGIN_PLUGIN_INFO_FLAGS_INTERNAL |
+                    GPLUGIN_PLUGIN_INFO_FLAGS_LOAD_ON_QUERY,
     NULL
   );
 }



More information about the Commits mailing list