network-manager-applet r816 - in trunk: . src/utils



Author: dcbw
Date: Fri Aug  1 20:37:12 2008
New Revision: 816
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=816&view=rev

Log:
2008-08-01  Dan Williams  <dcbw redhat com>

	* src/utils/utils.c
		- (fixup_desc_string): remove more bits of vendor and product strings



Modified:
   trunk/ChangeLog
   trunk/src/utils/utils.c

Modified: trunk/src/utils/utils.c
==============================================================================
--- trunk/src/utils/utils.c	(original)
+++ trunk/src/utils/utils.c	Fri Aug  1 20:37:12 2008
@@ -77,7 +77,7 @@
 	return result;
 }
 
-static char * ignored_words[] = {
+static char *ignored_words[] = {
 	"Semiconductor",
 	"Components",
 	"Corporation",
@@ -87,9 +87,22 @@
 	"Inc.",
 	"Inc",
 	"Ltd.",
-	"Multiprotocol",
-	"MAC/baseband",
-	"processor",
+	"chipset",
+	"adapter",
+	"[hex]",
+	NULL
+};
+
+static char *ignored_phrases[] = {
+	"Multiprotocol MAC/baseband processor",
+	"Wireless LAN Controller",
+	"Wireless LAN Adapter",
+	"Wireless Adapter",
+	"Network Connection",
+	"Wireless Cardbus Adapter",
+	"54 Mbps Wireless PC Card",
+	"Wireless PC Card",
+	"Wireless PC",
 	NULL
 };
 
@@ -107,7 +120,17 @@
 		p++;
 	}
 
-	/* Attmept to shorted ID by ignoring certain words */
+	/* Attempt to shorten ID by ignoring certain phrases */
+	for (item = ignored_phrases; *item; item++) {
+		guint32 temp_len = strlen (temp);
+		guint32 ignored_len = strlen (*item);
+
+		p = strstr (temp, *item);
+		if (p)
+			memmove (p, p + ignored_len, temp_len - (p - temp));
+	}
+
+	/* Attmept to shorten ID by ignoring certain individual words */
 	words = g_strsplit (temp, " ", 0);
 	str = g_string_new_len (NULL, strlen (temp));
 	g_free (temp);



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