/soc/2013/ankitkv/gobjectification: f184f7b4f11a: Silence glib w...

Ankit Vani a at nevitus.org
Sun Jan 12 09:55:45 EST 2014


Changeset: f184f7b4f11ad2842eb14d7ba954ba0d43397a4c
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-01-12 20:23 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/f184f7b4f11a

Description:

Silence glib warnings

diffstat:

 pidgin/gtkdialogs.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (36 lines):

diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c
--- a/pidgin/gtkdialogs.c
+++ b/pidgin/gtkdialogs.c
@@ -841,6 +841,7 @@ void pidgin_dialogs_plugins_info(void)
 	const char *pver, *plicense, *pwebsite, *pid;
 	gboolean ploaded, ploadable;
 	const char * const *authorlist;
+	guint n_authors;
 	static GtkWidget *plugins_info = NULL;
 
 	str = g_string_sized_new(4096);
@@ -857,10 +858,13 @@ void pidgin_dialogs_plugins_info(void)
 		pname = g_markup_escape_text(purple_plugin_info_get_name(info), -1);
 		authorlist = purple_plugin_info_get_authors(info);
 
-		if (authorlist)
+		if (authorlist) {
 			authors = g_strjoinv(", ", (gchar **)authorlist);
-		else
+			n_authors = g_strv_length((gchar **)authorlist);
+		} else {
 			authors = NULL;
+			n_authors = 0;
+		}
 
 		if (authors)
 			pauthors = g_markup_escape_text(authors, -1);
@@ -891,7 +895,7 @@ void pidgin_dialogs_plugins_info(void)
 				"<b>Loaded:</b> %s"
 				"</dd><br/>",
 				pname    ? pname    : "",
-				(g_strv_length((gchar **)authorlist) > 1 ? "Authors" : "Author"),
+				(n_authors > 1 ? "Authors" : "Author"),
 				pauthors ? pauthors : "",
 				pver     ? pver     : "",
 				plicense ? plicense : "",



More information about the Commits mailing list