GTK-2/3 UI: avoid g_strcasecmp

g_strcasecmp() was deprecated and produces warnings with later glib,
which is fatal with -Werror. The method is used to relax an equal
comparison of the config name. Config names are not case sensitive and
SyncEvolution is using a similar "to lower" approach, so relaxing the
comparison is okay, although it is uncertain why exactly it is
necessary and/or whether it catches all cases.

All strings are expected to be UTF-8, but because SyncEvolution only
does primitive lowercasing itself, calling g_ascii_strcasecmp() seems
like a better match than the full UTF-8 aware case handling methods in
glib.
This commit is contained in:
Patrick Ohly 2012-04-24 14:58:32 +02:00
parent 5eed5ea60b
commit 918b07bb18
4 changed files with 6 additions and 6 deletions

View File

@ -824,7 +824,7 @@ sync_config_widget_expand_id (SyncConfigWidget *self,
sync_config_widget_set_expanded (self, TRUE);
} else if (self->config_name &&
g_strcasecmp (self->config_name, id) == 0) {
g_ascii_strcasecmp (self->config_name, id) == 0) {
sync_config_widget_set_expanded (self, TRUE);
}

View File

@ -2001,7 +2001,7 @@ add_configuration_to_box (GtkBox *box,
if (data->current_service) {
current_name = data->current_service->pretty_name;
if (data->current_service->name && name &&
g_strcasecmp (name, data->current_service->name) == 0) {
g_ascii_strcasecmp (name, data->current_service->name) == 0) {
current = TRUE;
}
}
@ -3476,7 +3476,7 @@ server_presence_changed_cb (SyncevoServer *server,
{
if (data->current_service &&
config_name && status &&
g_strcasecmp (data->current_service->name, config_name) == 0) {
g_ascii_strcasecmp (data->current_service->name, config_name) == 0) {
set_online_status (data, strcmp (status, "") == 0);
}

View File

@ -803,7 +803,7 @@ sync_config_widget_expand_id (SyncConfigWidget *self,
sync_config_widget_set_expanded (self, TRUE);
} else if (self->config_name &&
g_strcasecmp (self->config_name, id) == 0) {
g_ascii_strcasecmp (self->config_name, id) == 0) {
sync_config_widget_set_expanded (self, TRUE);
}

View File

@ -1969,7 +1969,7 @@ add_configuration_to_box (GtkBox *box,
if (data->current_service) {
current_name = data->current_service->pretty_name;
if (data->current_service->name && name &&
g_strcasecmp (name, data->current_service->name) == 0) {
g_ascii_strcasecmp (name, data->current_service->name) == 0) {
current = TRUE;
}
}
@ -3444,7 +3444,7 @@ server_presence_changed_cb (SyncevoServer *server,
{
if (data->current_service &&
config_name && status &&
g_strcasecmp (data->current_service->name, config_name) == 0) {
g_ascii_strcasecmp (data->current_service->name, config_name) == 0) {
set_online_status (data, strcmp (status, "") == 0);
}