[network-manager-applet] trivial: various cleanups (bgo #644760)



commit a71f2865e80d234ccfba0db51a46d18bc4b4458e
Author: Kjartan Maraas <kmaraas gnome org>
Date:   Tue Mar 15 00:04:47 2011 -0500

    trivial: various cleanups (bgo #644760)
    
    Let g_free and g_strdup handle NULL, remove duplicate includes.

 src/applet-device-gsm.c          |    2 +-
 src/applet.c                     |    7 ++-----
 src/connection-editor/page-ip4.c |    1 -
 src/connection-editor/page-ip6.c |    1 -
 4 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index 52926e4..60aca0b 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -975,7 +975,7 @@ find_provider_for_mcc_mnc (GHashTable *table, const char *mccmnc)
 
 	if (name3)
 		return g_strdup (name3);
-	return name2 ? g_strdup (name2) : NULL;
+	return g_strdup (name2);
 }
 
 static char *
diff --git a/src/applet.c b/src/applet.c
index 0d94eaf..9fa4832 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -60,7 +60,6 @@
 #include <nm-setting-bluetooth.h>
 #include <nm-setting-vpn.h>
 #include <nm-active-connection.h>
-#include <nm-setting-wireless.h>
 #include <nm-secret-agent.h>
 
 #include <gconf/gconf-client.h>
@@ -2554,10 +2553,8 @@ applet_update_icon (gpointer user_data)
 	}
 	foo_set_icon (applet, pixbuf, ICON_LAYER_VPN);
 
-	if (applet->tip) {
-		g_free (applet->tip);
-		applet->tip = NULL;
-	}
+	g_free (applet->tip);
+	applet->tip = NULL;
 
 	if (dev_tip || vpn_tip) {
 		GString *tip;
diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c
index ea711ba..2652634 100644
--- a/src/connection-editor/page-ip4.c
+++ b/src/connection-editor/page-ip4.c
@@ -25,7 +25,6 @@
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
-#include <arpa/inet.h>
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index 6dcd04e..e027620 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -25,7 +25,6 @@
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
-#include <arpa/inet.h>
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]