/pidgin/main: 7ea89f3b3b58: Silence some warnings

Ankit Vani a at nevitus.org
Tue Dec 31 12:41:51 EST 2013


Changeset: 7ea89f3b3b581e02e862765e35747671b6360b3c
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-12-31 23:10 +0530
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/7ea89f3b3b58

Description:

Silence some warnings

diffstat:

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

diffs (34 lines):

diff --git a/pidgin/plugins/unity.c b/pidgin/plugins/unity.c
--- a/pidgin/plugins/unity.c
+++ b/pidgin/plugins/unity.c
@@ -56,7 +56,9 @@ update_launcher()
 {
 	guint count = 0;
 	GList *convs = NULL;
-	g_return_if_fail(launcher != NULL && launcher_count != LAUNCHER_COUNT_DISABLE);
+	g_return_if_fail(launcher != NULL);
+	if (launcher_count == LAUNCHER_COUNT_DISABLE)
+		return;
 
 	if (launcher_count == LAUNCHER_COUNT_MESSAGES) {
 		for (convs = purple_get_conversations(); convs != NULL; convs = convs->next) {
@@ -357,7 +359,8 @@ static void
 launcher_config_cb(GtkWidget *widget, gpointer data)
 {
 	gint option = GPOINTER_TO_INT(data);
-	g_return_if_fail(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+	if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+		return;
 
 	purple_prefs_set_int("/plugins/gtk/unity/launcher_count", option);
 	launcher_count = option;
@@ -371,7 +374,8 @@ static void
 messaging_menu_config_cb(GtkWidget *widget, gpointer data)
 {
 	gint option = GPOINTER_TO_INT(data);
-	g_return_if_fail(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
+	if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+		return;
 
 	purple_prefs_set_int("/plugins/gtk/unity/messaging_menu_text", option);
 	messaging_menu_text = option;



More information about the Commits mailing list