/soc/2013/ankitkv/gobjectification: 345ec7248f48: Updated plugin...

Ankit Vani a at nevitus.org
Fri Aug 9 16:23:33 EDT 2013


Changeset: 345ec7248f481d026eba6b0de4294ce0abbdff94
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-10 01:14 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/345ec7248f48

Description:

Updated plugin info properties as per changes in GPlugin

diffstat:

 finch/gntplugin.c                   |   4 ++--
 finch/gntplugin.h                   |   2 +-
 libpurple/plugins.c                 |  14 ++++++++++----
 libpurple/plugins.h                 |  10 ++++++----
 libpurple/protocols/null/nullprpl.c |   2 +-
 pidgin/gtkplugin.c                  |   4 ++--
 pidgin/gtkplugin.h                  |   2 +-
 7 files changed, 23 insertions(+), 15 deletions(-)

diffs (138 lines):

diff --git a/finch/gntplugin.c b/finch/gntplugin.c
--- a/finch/gntplugin.c
+++ b/finch/gntplugin.c
@@ -115,7 +115,7 @@ static void finch_plugin_info_class_init
 	obj_class->set_property = finch_plugin_info_set_property;
 
 	g_object_class_install_property(obj_class, PROP_FINCH_PREFERENCES_FRAME,
-		g_param_spec_pointer("finch_preferences_frame",
+		g_param_spec_pointer("finch-preferences-frame",
 		                     "Finch preferences frame callback",
 		                     "Callback that returns a GNT preferences frame",
 		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
@@ -155,7 +155,7 @@ finch_plugin_info_new(const char *first_
 	                           var_args);
 	va_end(var_args);
 
-	g_object_set(info, "ui_requirement", FINCH_UI, NULL);
+	g_object_set(info, "ui-requirement", FINCH_UI, NULL);
 
 	return FINCH_PLUGIN_INFO(info);
 }
diff --git a/finch/gntplugin.h b/finch/gntplugin.h
--- a/finch/gntplugin.h
+++ b/finch/gntplugin.h
@@ -88,7 +88,7 @@ GType finch_plugin_info_get_type(void);
  * pairs.
  *
  * See purple_plugin_info_new() for a list of available property names.
- * Additionally, you can provide the property "finch_preferences_frame",
+ * Additionally, you can provide the property "finch-preferences-frame",
  * which should be a callback that returns a GntWidget for the plugin's
  * preferences (see FinchPluginFrame).
  *
diff --git a/libpurple/plugins.c b/libpurple/plugins.c
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -90,9 +90,15 @@ purple_plugin_load(PurplePlugin *plugin)
 	}
 
 	if (!gplugin_plugin_manager_load_plugin(plugin, &error)) {
+		PurplePluginInfoPrivate *priv =
+				PURPLE_PLUGIN_INFO_GET_PRIVATE(purple_plugin_get_info(plugin));
+		g_free(priv->error);
+		priv->error = g_strdup(error->message);
+		g_error_free(error);
+
 		purple_debug_error("plugins", "Failed to load plugin %s: %s",
-				purple_plugin_get_filename(plugin), error->message);
-		g_error_free(error);
+				purple_plugin_get_filename(plugin),
+				purple_plugin_get_error(plugin));
 		return FALSE;
 	}
 
@@ -344,8 +350,8 @@ purple_plugin_get_dependent_plugins(cons
  **************************************************************************/
 /* GObject Property names */
 #define PROP_CATEGORY_S           "category"
-#define PROP_UI_REQUIREMENT_S     "ui_requirement"
-#define PROP_PREFERENCES_FRAME_S  "preferences_frame"
+#define PROP_UI_REQUIREMENT_S     "ui-requirement"
+#define PROP_PREFERENCES_FRAME_S  "preferences-frame"
 
 /* Set method for GObject properties */
 static void
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" and "abi_version" are optional.
+ * All properties except "id" and "abi-version" are optional.
  *
  * Valid property names are:                                                 \n
  * "id"                 (string) The ID of the plugin.                       \n
@@ -381,10 +381,12 @@ GType purple_plugin_info_get_type(void);
  * "author"             (string) Author of the plugin                        \n
  * "website"            (string) Website of the plugin                       \n
  * "icon"               (string) Path to a plugin's icon                     \n
- * "license"            (string) The plugin's license                        \n
- * "abi_version"        (guint32) The required ABI version for the plugin.   \n
+ * "license"            (string) The plugin's license ID                     \n
+ * "license-text"       (string) The plugin's license text                   \n
+ * "license-url"        (string) The plugin's license URL                    \n
+ * "abi-version"        (guint32) The required ABI version for the plugin.   \n
  * "dependencies"       (GSList) List of plugin IDs required by the plugin.  \n
- * "preferences_frame"  (PurplePluginPrefFrameCallback) Callback that returns
+ * "preferences-frame"  (PurplePluginPrefFrameCallback) Callback that returns
  *                      a preferences frame for the plugin.
  *
  * Additionally, you can provide a "flags" property if the plugin is to be
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
@@ -1145,7 +1145,7 @@ plugin_query(void)
     "summary",      N_("Null Protocol Plugin"),
     "description",  N_("Null Protocol Plugin"),
     "website",      PURPLE_WEBSITE,
-    "abi_version",  PURPLE_ABI_VERSION,
+    "abi-version",  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.*/
diff --git a/pidgin/gtkplugin.c b/pidgin/gtkplugin.c
--- a/pidgin/gtkplugin.c
+++ b/pidgin/gtkplugin.c
@@ -117,7 +117,7 @@ static void pidgin_plugin_info_class_ini
 	obj_class->set_property = pidgin_plugin_info_set_property;
 
 	g_object_class_install_property(obj_class, PROP_PIDGIN_CONFIG_FRAME,
-		g_param_spec_pointer("pidgin_config_frame",
+		g_param_spec_pointer("pidgin-config-frame",
 		                     "Pidgin configuration frame callback",
 		                     "Callback that returns a GTK configuration frame",
 		                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
@@ -157,7 +157,7 @@ pidgin_plugin_info_new(const char *first
 	                           var_args);
 	va_end(var_args);
 
-	g_object_set(info, "ui_requirement", PIDGIN_UI, NULL);
+	g_object_set(info, "ui-requirement", PIDGIN_UI, NULL);
 
 	return PIDGIN_PLUGIN_INFO(info);
 }
diff --git a/pidgin/gtkplugin.h b/pidgin/gtkplugin.h
--- a/pidgin/gtkplugin.h
+++ b/pidgin/gtkplugin.h
@@ -79,7 +79,7 @@ GType pidgin_plugin_info_get_type(void);
  * pairs.
  *
  * See purple_plugin_info_new() for a list of available property names.
- * Additionally, you can provide the property "pidgin_config_frame",
+ * Additionally, you can provide the property "pidgin-config-frame",
  * which should be a callback that returns a GtkWidget for the plugin's
  * configuration (see PidginPluginConfigFrame).
  *



More information about the Commits mailing list