empathy r1618 - trunk/src



Author: xclaesse
Date: Fri Oct 17 12:47:08 2008
New Revision: 1618
URL: http://svn.gnome.org/viewvc/empathy?rev=1618&view=rev

Log:
Use tp_strdiff instead of strcmp. (Jonny Lamb)

Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>

Modified:
   trunk/src/empathy-import-dialog.c

Modified: trunk/src/empathy-import-dialog.c
==============================================================================
--- trunk/src/empathy-import-dialog.c	(original)
+++ trunk/src/empathy-import-dialog.c	Fri Oct 17 12:47:08 2008
@@ -230,8 +230,8 @@
   /* Search for the map corresponding to setting we are parsing */
   for (i = 0; i < G_N_ELEMENTS (pidgin_mc_map); i++)
     {
-      if (strcmp (data->protocol, pidgin_mc_map[i].protocol) == 0 &&
-          strcmp (tag_name, pidgin_mc_map[i].pidgin_name) == 0)
+      if (!tp_strdiff (data->protocol, pidgin_mc_map[i].protocol) &&
+          !tp_strdiff (tag_name, pidgin_mc_map[i].pidgin_name))
         {
           item = pidgin_mc_map + i;
           break;
@@ -246,19 +246,19 @@
   type = (gchar *) xmlGetProp (setting, PIDGIN_SETTING_PROP_TYPE);
   content = (gchar *) xmlNodeGetContent (setting);
 
-  if (strcmp (type, "bool") == 0)
+  if (!tp_strdiff (type, "bool"))
     {
       sscanf (content, "%i", &i);
       value = tp_g_value_slice_new (G_TYPE_BOOLEAN);
       g_value_set_boolean (value, i != 0);
     }
-  else if (strcmp (type, "int") == 0)
+  else if (!tp_strdiff (type, "int"))
     {
       sscanf (content, "%i", &i);
       value = tp_g_value_slice_new (G_TYPE_INT);
       g_value_set_int (value, i);
     }
-  else if (strcmp (type, "string") == 0)
+  else if (!tp_strdiff (type, "string"))
     {
       value = tp_g_value_slice_new (G_TYPE_STRING);
       g_value_set_string (value, content);
@@ -295,8 +295,8 @@
     {
       AccountData *data;
 
-      /* If it is not an account node, skip */
-      if (strcmp ((gchar *) node->name, PIDGIN_ACCOUNT_TAG_ACCOUNT) != 0)
+      /* If it is not an account node, skip. */
+      if (tp_strdiff ((gchar *) node->name, PIDGIN_ACCOUNT_TAG_ACCOUNT))
         continue;
 
       /* Create account data struct */
@@ -310,8 +310,8 @@
           GValue *value;
 
           /* Protocol */
-          if (strcmp ((gchar *) child->name,
-              PIDGIN_ACCOUNT_TAG_PROTOCOL) == 0)
+          if (!tp_strdiff ((gchar *) child->name,
+              PIDGIN_ACCOUNT_TAG_PROTOCOL))
             {
               const gchar *protocol;
               gchar *content;
@@ -321,9 +321,9 @@
               if (g_str_has_prefix (protocol, "prpl-"))
                 protocol += 5;
 
-              if (strcmp (protocol, PIDGIN_PROTOCOL_BONJOUR) == 0)
+              if (!tp_strdiff (protocol, PIDGIN_PROTOCOL_BONJOUR))
                 protocol = "salut";
-              else if (strcmp (protocol, PIDGIN_PROTOCOL_NOVELL) == 0)
+              else if (!tp_strdiff (protocol, PIDGIN_PROTOCOL_NOVELL))
                 protocol = "groupwise";
 
               data->protocol = g_strdup (protocol);
@@ -331,8 +331,8 @@
             }
 
           /* Username and IRC server. */
-          else if (strcmp ((gchar *) child->name,
-              PIDGIN_ACCOUNT_TAG_NAME) == 0)
+          else if (!tp_strdiff ((gchar *) child->name,
+              PIDGIN_ACCOUNT_TAG_NAME))
             {
               gchar *name;
               GStrv name_resource = NULL;
@@ -352,7 +352,7 @@
 
              /* Split "username server" if it is an IRC account */
              if (data->protocol && strstr (name, "@") &&
-                 strcmp (data->protocol, "irc") == 0)
+                 !tp_strdiff (data->protocol, "irc"))
               {
                 nick_server = g_strsplit (name, "@", 2);
                 username = nick_server[0];
@@ -374,8 +374,8 @@
             }
 
           /* Password */
-          else if (strcmp ((gchar *) child->name,
-              PIDGIN_ACCOUNT_TAG_PASSWORD) == 0)
+          else if (!tp_strdiff ((gchar *) child->name,
+              PIDGIN_ACCOUNT_TAG_PASSWORD))
             {
               gchar *password;
 
@@ -390,8 +390,8 @@
             }
 
           /* Other settings */
-          else if (strcmp ((gchar *) child->name,
-              PIDGIN_ACCOUNT_TAG_SETTINGS) == 0)
+          else if (!tp_strdiff ((gchar *) child->name,
+              PIDGIN_ACCOUNT_TAG_SETTINGS))
               for (setting = child->children; setting; setting = setting->next)
                 import_dialog_pidgin_parse_setting (data, setting);
         }



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