/* 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;
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);
{
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 */
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;
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);
}
/* 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;
/* 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];
}
/* 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;
}
/* 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);
}