/soc/2013/ankitkv/gobjectification: e7b9735ffdb9: Removed unnece...

Ankit Vani a at nevitus.org
Sun Aug 11 11:45:46 EDT 2013


Changeset: e7b9735ffdb9c0f9f6dad86df99388afd5d70a3f
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-11 21:15 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/e7b9735ffdb9

Description:

Removed unnecessary variable 'loadable'

diffstat:

 libpurple/plugins.c |  14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diffs (54 lines):

diff --git a/libpurple/plugins.c b/libpurple/plugins.c
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -36,8 +36,7 @@ typedef struct _PurplePluginInfoPrivate 
  **************************************************************************/
 struct _PurplePluginInfoPrivate {
 	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               */
+	char *error;           /**< Why a plugin is not loadable                 */
 
 	/** Callback that returns a list of actions the plugin can perform */
 	PurplePluginGetActionsCallback get_actions;
@@ -86,7 +85,7 @@ purple_plugin_load(PurplePlugin *plugin,
 
 	priv = PURPLE_PLUGIN_INFO_GET_PRIVATE(purple_plugin_get_info(plugin));
 
-	if (!priv->loadable) {
+	if (priv->error) {
 		purple_debug_error("plugins", "Failed to load plugin %s: %s",
 		                   purple_plugin_get_filename(plugin), priv->error);
 
@@ -353,15 +352,8 @@ purple_plugin_info_constructed(GObject *
 
 	parent_class->constructed(object);
 
-	priv->loadable = TRUE;
-
 	if (id == NULL || *id == '\0')
-	{
-		/* GPlugin already logs a warning when a plugin has no ID */
-
 		priv->error = g_strdup(_("This plugin has not defined an ID."));
-		priv->loadable = FALSE;
-	}
 
 	if (priv->ui_requirement && !purple_strequal(priv->ui_requirement, purple_core_get_ui()))
 	{
@@ -369,7 +361,6 @@ purple_plugin_info_constructed(GObject *
 				purple_core_get_ui(), priv->ui_requirement);
 		purple_debug_error("plugins", "%s is not loadable: The UI requirement is not met. (%s)\n",
 				id, priv->error);
-		priv->loadable = FALSE;
 	}
 
 	version = purple_plugin_info_get_abi_version(info);
@@ -384,7 +375,6 @@ purple_plugin_info_constructed(GObject *
 				id, PURPLE_PLUGIN_ABI_MAJOR_VERSION(version),
 				PURPLE_PLUGIN_ABI_MINOR_VERSION(version),
 				PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION);
-		priv->loadable = FALSE;
 	}
 }
 



More information about the Commits mailing list