Commit b132e880 authored by Tristan Matthews's avatar Tristan Matthews

* #9145: replaced calls to deprecated "g_strcasecmp" with utf8_case_cmp

The helper function works with UTF8 strings, however a more optimal
solution is probably possible.
parent 671cd0fa
......@@ -27,12 +27,13 @@ sflphone_client_gnome_SOURCES = \
codeclist.c \
reqaccount.c \
eel-gconf-extensions.c \
shortcuts.c
shortcuts.c \
str_utils.c
noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \
reqaccount.h sflphone_const.h uimanager.h \
accountlist.h sliders.h statusicon.h callable_obj.h conference_obj.h \
shortcuts.h eel-gconf-extensions.h logger.h imwindow.h unused.h
shortcuts.h eel-gconf-extensions.h logger.h imwindow.h unused.h str_utils.h
sflphone_client_gnome_LDADD = $(DBUSGLIB_LIBS) $(LIBNOTIFY_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(X11_LIBS) \
$(GTK_LIBS) $(GLIB_LIBS) $(WEBKIT_LIBS) $(LD_LIBS) $(GCONF_LIBS)
......
......@@ -30,6 +30,7 @@
*/
#include <glib/gi18n.h>
#include "str_utils.h"
#include "accountlist.h"
#include "actions.h"
#include "unused.h"
......@@ -43,7 +44,7 @@ static guint account_list_get_position(account_t *account)
for (guint i = 0; i < size; i++) {
account_t *tmp = account_list_get_nth(i);
if (g_strcasecmp(tmp->accountID, account->accountID) == 0)
if (utf8_case_cmp(tmp->accountID, account->accountID) == 0)
return i;
}
......@@ -266,7 +267,7 @@ gboolean current_account_has_mailbox(void)
if (current) {
gchar * account_mailbox = g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX);
if (account_mailbox && g_strcasecmp(account_mailbox, "") != 0)
if (account_mailbox && utf8_case_cmp(account_mailbox, "") != 0)
return TRUE;
}
......
......@@ -37,6 +37,8 @@
#else
#include <gdk/gdkkeysyms.h>
#endif
#include "str_utils.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
......@@ -101,7 +103,7 @@ sflphone_notify_voice_mail(const gchar* accountID , guint count)
static gboolean is_direct_call(callable_obj_t * c)
{
if (g_strcasecmp(c->_accountID, "empty") == 0) {
if (utf8_case_cmp(c->_accountID, "empty") == 0) {
if (!g_str_has_prefix(c->_peer_number, "sip:")) {
gchar * new_number = g_strconcat("sip:", c->_peer_number, NULL);
g_free(c->_peer_number);
......@@ -817,7 +819,7 @@ static int place_registered_call(callable_obj_t * c)
}
gpointer status = g_hash_table_lookup(current->properties, "Status");
if (status && g_strcasecmp(status, "REGISTERED") == 0) {
if (status && utf8_case_cmp(status, "REGISTERED") == 0) {
/* The call is made with the current account */
// free memory for previous account id and get a new one
g_free(c->_accountID);
......
......@@ -29,6 +29,7 @@
*/
#include "callable_obj.h"
#include "str_utils.h"
#include "codeclist.h"
#include "sflphone_const.h"
#include <time.h>
......@@ -146,15 +147,15 @@ callable_obj_t *create_new_call_from_details(const gchar *call_id, GHashTable *d
const gchar * const display_name = g_hash_table_lookup(details, "DISPLAY_NAME");
const gchar * const state_str = g_hash_table_lookup(details, "CALL_STATE");
if (g_strcasecmp(state_str, "CURRENT") == 0)
if (utf8_case_cmp(state_str, "CURRENT") == 0)
state = CALL_STATE_CURRENT;
else if (g_strcasecmp(state_str, "RINGING") == 0)
else if (utf8_case_cmp(state_str, "RINGING") == 0)
state = CALL_STATE_RINGING;
else if (g_strcasecmp(state_str, "INCOMING") == 0)
else if (utf8_case_cmp(state_str, "INCOMING") == 0)
state = CALL_STATE_INCOMING;
else if (g_strcasecmp(state_str, "HOLD") == 0)
else if (utf8_case_cmp(state_str, "HOLD") == 0)
state = CALL_STATE_HOLD;
else if (g_strcasecmp(state_str, "BUSY") == 0)
else if (utf8_case_cmp(state_str, "BUSY") == 0)
state = CALL_STATE_BUSY;
else
state = CALL_STATE_FAILURE;
......
......@@ -31,6 +31,7 @@
#include <time.h>
#include "callable_obj.h"
#include "str_utils.h"
#include "dbus.h"
#include "sflphone_const.h"
#include "logger.h"
......@@ -80,17 +81,17 @@ conference_obj_t *create_new_conference_from_details(const gchar *conf_id, GHash
gchar *state_str = g_hash_table_lookup(details, "CONF_STATE");
if (g_strcasecmp(state_str, "ACTIVE_ATTACHED") == 0)
if (utf8_case_cmp(state_str, "ACTIVE_ATTACHED") == 0)
new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED;
else if (g_strcasecmp(state_str, "ACTIVE_ATTACHED_REC") == 0)
else if (utf8_case_cmp(state_str, "ACTIVE_ATTACHED_REC") == 0)
new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;
else if (g_strcasecmp(state_str, "ACTIVE_DETACHED") == 0)
else if (utf8_case_cmp(state_str, "ACTIVE_DETACHED") == 0)
new_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED;
else if (g_strcasecmp(state_str, "ACTIVE_DETACHED_REC") == 0)
else if (utf8_case_cmp(state_str, "ACTIVE_DETACHED_REC") == 0)
new_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED_RECORD;
else if (g_strcasecmp(state_str, "HOLD") == 0)
else if (utf8_case_cmp(state_str, "HOLD") == 0)
new_conf->_state = CONFERENCE_STATE_HOLD;
else if (g_strcasecmp(state_str, "HOLD_REC") == 0)
else if (utf8_case_cmp(state_str, "HOLD_REC") == 0)
new_conf->_state = CONFERENCE_STATE_HOLD_RECORD;
return new_conf;
......
......@@ -40,6 +40,7 @@
#include <gtk/gtk.h>
#include "config.h"
#include "str_utils.h"
#include "logger.h"
#include "actions.h"
#include "mainwindow.h"
......@@ -134,7 +135,7 @@ void change_protocol_cb(account_t *currentAccount UNUSED)
// Only if tabs are not NULL
if (security_tab && advanced_tab) {
if (g_strcasecmp(protocol, "IAX") == 0) {
if (utf8_case_cmp(protocol, "IAX") == 0) {
gtk_widget_hide(security_tab);
gtk_widget_hide(advanced_tab);
} else {
......@@ -440,8 +441,8 @@ static void cell_edited_cb(GtkCellRendererText *renderer, gchar *path_desc, gcha
gint column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(renderer), "column"));
DEBUG("path desc in cell_edited_cb: %s\n", text);
if ((g_strcasecmp(path_desc, "0") == 0) &&
g_strcasecmp(text, gtk_entry_get_text(GTK_ENTRY(entryUsername))) != 0)
if ((utf8_case_cmp(path_desc, "0") == 0) &&
utf8_case_cmp(text, gtk_entry_get_text(GTK_ENTRY(entryUsername))) != 0)
g_signal_handlers_disconnect_by_func(G_OBJECT(entryUsername), G_CALLBACK(update_credential_cb), NULL);
GtkTreeIter iter;
......@@ -456,7 +457,7 @@ static void editing_started_cb(GtkCellRenderer *cell UNUSED, GtkCellEditable * e
DEBUG("path desc in editing_started_cb: %s\n", path);
// If we are dealing the first row
if (g_strcasecmp(path, "0") == 0)
if (utf8_case_cmp(path, "0") == 0)
gtk_entry_set_text(GTK_ENTRY(editable), gtk_entry_get_text(GTK_ENTRY(entryPassword)));
}
......@@ -464,7 +465,7 @@ static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer dat
{
gchar *proto = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo));
if (g_strcasecmp(proto, "ZRTP") == 0)
if (utf8_case_cmp(proto, "ZRTP") == 0)
show_advanced_zrtp_options((GHashTable *) data);
else
show_advanced_sdes_options((GHashTable *) data);
......@@ -484,8 +485,8 @@ static void key_exchange_changed_cb(GtkWidget *widget UNUSED, gpointer data UNUS
DEBUG("Key exchange changed %s", active_text);
gboolean set_sensitive = FALSE;
set_sensitive |= g_strcasecmp(active_text, "SDES") == 0;
set_sensitive |= g_strcasecmp(active_text, "ZRTP") == 0;
set_sensitive |= utf8_case_cmp(active_text, "SDES") == 0;
set_sensitive |= utf8_case_cmp(active_text, "ZRTP") == 0;
g_free(active_text);
if (set_sensitive)
......@@ -863,7 +864,7 @@ static GtkWidget* create_registration_expire(account_t *a)
entryResolveNameOnlyOnce = gtk_check_button_new_with_mnemonic(_("_Comply with RFC 3263"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce),
g_strcasecmp(resolve_once,"false") == 0 ? TRUE: FALSE);
utf8_case_cmp(resolve_once,"false") == 0 ? TRUE: FALSE);
gtk_table_attach_defaults(GTK_TABLE(table), entryResolveNameOnlyOnce, 0, 2, 1, 2);
gtk_widget_set_sensitive(entryResolveNameOnlyOnce , TRUE);
......@@ -952,7 +953,7 @@ GtkWidget* create_published_address(account_t *a)
use_tls = g_hash_table_lookup(a->properties, TLS_ENABLE);
published_sameas_local = g_hash_table_lookup(a->properties, PUBLISHED_SAMEAS_LOCAL);
if (g_strcasecmp(published_sameas_local, "true") == 0) {
if (utf8_case_cmp(published_sameas_local, "true") == 0) {
published_address = dbus_get_address_from_interface_name(g_hash_table_lookup(a->properties, LOCAL_INTERFACE));
published_port = g_hash_table_lookup(a->properties, LOCAL_PORT);
} else {
......@@ -973,9 +974,9 @@ GtkWidget* create_published_address(account_t *a)
gtk_table_attach_defaults(GTK_TABLE(table), useStunCheckBox, 0, 1, 0, 1);
g_signal_connect(useStunCheckBox, "toggled", G_CALLBACK(use_stun_cb), a);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useStunCheckBox),
g_strcasecmp(stun_enable, "true") == 0 ? TRUE: FALSE);
utf8_case_cmp(stun_enable, "true") == 0 ? TRUE: FALSE);
gtk_widget_set_sensitive(useStunCheckBox,
g_strcasecmp(use_tls, "true") == 0 ? FALSE: TRUE);
utf8_case_cmp(use_tls, "true") == 0 ? FALSE: TRUE);
stunServerLabel = gtk_label_new_with_mnemonic(_("STUN server URL"));
gtk_table_attach_defaults(GTK_TABLE(table), stunServerLabel, 0, 1, 1, 2);
......@@ -991,7 +992,7 @@ GtkWidget* create_published_address(account_t *a)
publishedAddrRadioButton = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(sameAsLocalRadioButton), _("Set published address and port:"));
gtk_table_attach_defaults(GTK_TABLE(table), publishedAddrRadioButton, 0, 2, 4, 5);
if (g_strcasecmp(published_sameas_local, "true") == 0) {
if (utf8_case_cmp(published_sameas_local, "true") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(publishedAddrRadioButton), FALSE);
} else {
......@@ -1097,7 +1098,7 @@ static GtkWidget* create_audiocodecs_configuration(account_t *currentAccount)
gboolean dtmf_are_rtp = TRUE;
if (g_strcasecmp(currentDtmfType, OVERRTP) != 0)
if (utf8_case_cmp(currentDtmfType, OVERRTP) != 0)
dtmf_are_rtp = FALSE;
overrtp = gtk_radio_button_new_with_label(NULL, _("RTP"));
......@@ -1204,7 +1205,7 @@ void show_account_window(account_t * currentAccount)
gtk_widget_show(notebook);
// We do not need the global settings for the IP2IP account
if (g_strcasecmp(currentAccount->accountID, IP2IP) != 0) {
if (utf8_case_cmp(currentAccount->accountID, IP2IP) != 0) {
/* General Settings */
GtkWidget *basic_tab = create_basic_tab(currentAccount);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), basic_tab, gtk_label_new(_("Basic")));
......@@ -1225,7 +1226,7 @@ void show_account_window(account_t * currentAccount)
currentProtocol = g_strdup("SIP");
// Do not need advanced or security one for the IP2IP account
if (g_strcasecmp(currentAccount->accountID, IP2IP) != 0) {
if (utf8_case_cmp(currentAccount->accountID, IP2IP) != 0) {
/* Advanced */
advanced_tab = create_advanced_tab(currentAccount);
......@@ -1271,7 +1272,7 @@ void show_account_window(account_t * currentAccount)
}
// If accept button is
if (g_strcasecmp(currentAccount->accountID, IP2IP) != 0) {
if (utf8_case_cmp(currentAccount->accountID, IP2IP) != 0) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ALIAS),
......@@ -1294,7 +1295,7 @@ void show_account_window(account_t * currentAccount)
}
if (g_strcmp0(proto, "SIP") == 0) {
if (g_strcasecmp(currentAccount->accountID, IP2IP) != 0) {
if (utf8_case_cmp(currentAccount->accountID, IP2IP) != 0) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_RESOLVE_ONCE),
......@@ -1356,10 +1357,10 @@ void show_account_window(account_t * currentAccount)
gchar* keyExchange = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo));
if (g_strcasecmp(keyExchange, "ZRTP") == 0) {
if (utf8_case_cmp(keyExchange, "ZRTP") == 0) {
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true"));
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(ZRTP));
} else if (g_strcasecmp(keyExchange, "SDES") == 0) {
} else if (utf8_case_cmp(keyExchange, "SDES") == 0) {
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true"));
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(SDES));
} else {
......@@ -1392,7 +1393,7 @@ void show_account_window(account_t * currentAccount)
}
/** @todo Verify if it's the best condition to check */
if (g_strcasecmp(currentAccount->accountID, "new") == 0)
if (utf8_case_cmp(currentAccount->accountID, "new") == 0)
dbus_add_account(currentAccount);
else
dbus_set_account_details(currentAccount);
......@@ -1401,7 +1402,7 @@ void show_account_window(account_t * currentAccount)
/* Set new credentials if any */
DEBUG("Config: Setting credentials");
if (g_strcasecmp(currentAccount->accountID, IP2IP) != 0) {
if (utf8_case_cmp(currentAccount->accountID, IP2IP) != 0) {
DEBUG("Config: Get new credentials");
currentAccount->credential_information = getNewCredential();
......
......@@ -31,6 +31,7 @@
#include "accountlistconfigdialog.h"
#include "str_utils.h"
#include "dbus/dbus.h"
#include "accountconfigdialog.h"
#include "actions.h"
......@@ -129,7 +130,7 @@ void account_list_config_dialog_fill()
COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name
COLUMN_ACCOUNT_TYPE, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol
COLUMN_ACCOUNT_STATUS, account_state_name(a->state), // Status
COLUMN_ACCOUNT_ACTIVE, (g_strcasecmp(g_hash_table_lookup(a->properties, ACCOUNT_ENABLED),"true") == 0) ? TRUE:FALSE, // Enable/Disable
COLUMN_ACCOUNT_ACTIVE, (utf8_case_cmp(g_hash_table_lookup(a->properties, ACCOUNT_ENABLED),"true") == 0) ? TRUE:FALSE, // Enable/Disable
COLUMN_ACCOUNT_DATA, a, // Pointer
-1);
......@@ -151,7 +152,7 @@ void account_list_config_dialog_fill()
COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name
COLUMN_ACCOUNT_TYPE, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol
COLUMN_ACCOUNT_STATUS, account_state_name(a->state), // Status
COLUMN_ACCOUNT_ACTIVE, (g_strcasecmp(g_hash_table_lookup(a->properties, ACCOUNT_ENABLED),"true") == 0) ? TRUE:FALSE, // Enable/Disable
COLUMN_ACCOUNT_ACTIVE, (utf8_case_cmp(g_hash_table_lookup(a->properties, ACCOUNT_ENABLED),"true") == 0) ? TRUE:FALSE, // Enable/Disable
COLUMN_ACCOUNT_DATA, a, // Pointer
-1);
}
......@@ -188,7 +189,7 @@ select_account_cb(GtkTreeSelection *selection, GtkTreeModel *model)
if (selectedAccount != NULL) {
gtk_widget_set_sensitive(GTK_WIDGET(editButton), TRUE);
if (g_strcasecmp(selectedAccount->accountID, IP2IP) != 0) {
if (utf8_case_cmp(selectedAccount->accountID, IP2IP) != 0) {
gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), TRUE);
......@@ -238,7 +239,7 @@ static void enable_account_cb(GtkCellRendererToggle *rend UNUSED, gchar* path,
account_t* acc ;
// The IP2IP profile can't be disabled
if (g_strcasecmp(path, "0") == 0)
if (utf8_case_cmp(path, "0") == 0)
return;
// Get pointer on object
......@@ -300,7 +301,7 @@ static void account_move(gboolean moveUp, gpointer data)
// The first real account in the list can't move up because of the IP2IP account
// It can still move down though
if (g_strcasecmp(path, "1") == 0 && moveUp)
if (utf8_case_cmp(path, "1") == 0 && moveUp)
return;
treePath = gtk_tree_path_new_from_string(path);
......@@ -395,7 +396,7 @@ void highlight_ip_profile(GtkTreeViewColumn *col UNUSED, GtkCellRenderer *rend,
if (current != NULL) {
// Make the first line appear differently
(g_strcasecmp(current->accountID, IP2IP) == 0) ? g_object_set(G_OBJECT(rend), "weight", PANGO_WEIGHT_THIN,
(utf8_case_cmp(current->accountID, IP2IP) == 0) ? g_object_set(G_OBJECT(rend), "weight", PANGO_WEIGHT_THIN,
"style", PANGO_STYLE_ITALIC,
"stretch", PANGO_STRETCH_ULTRA_EXPANDED,
"scale", 0.95,
......@@ -421,7 +422,7 @@ void highlight_registration(GtkTreeViewColumn *col UNUSED, GtkCellRenderer *rend
g_value_unset(&val);
if (current != NULL) {
if (g_strcasecmp(current->accountID, IP2IP) != 0) {
if (utf8_case_cmp(current->accountID, IP2IP) != 0) {
// Color the account state: green -> registered, otherwise red
(current->state == ACCOUNT_STATE_REGISTERED) ? g_object_set(G_OBJECT(rend), "foreground", "Dark Green", NULL) :
g_object_set(G_OBJECT(rend), "foreground", "Dark Red", NULL);
......
......@@ -29,6 +29,7 @@
*/
#include "addressbook-config.h"
#include "str_utils.h"
#include "dbus.h"
#include "unused.h"
#include "logger.h"
......@@ -443,13 +444,13 @@ addressbook_display(AddressBook_Config *settings, const gchar *field)
{
gboolean display;
if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO) == 0)
if (utf8_case_cmp(field, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO) == 0)
display = (settings->display_contact_photo == 1) ? TRUE : FALSE;
else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS) == 0)
else if (utf8_case_cmp(field, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS) == 0)
display = (settings->search_phone_business == 1) ? TRUE : FALSE;
else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_HOME) == 0)
else if (utf8_case_cmp(field, ADDRESSBOOK_DISPLAY_PHONE_HOME) == 0)
display = (settings->search_phone_home == 1) ? TRUE : FALSE;
else if (g_strcasecmp(field, ADDRESSBOOK_DISPLAY_PHONE_MOBILE) == 0)
else if (utf8_case_cmp(field, ADDRESSBOOK_DISPLAY_PHONE_MOBILE) == 0)
display = (settings->search_phone_mobile == 1) ? TRUE : FALSE;
else
display = FALSE;
......
......@@ -29,6 +29,7 @@
*/
#include <glib/gi18n.h>
#include "str_utils.h"
#include "audioconf.h"
#include "utils.h"
#include "logger.h"
......@@ -271,7 +272,7 @@ select_active_input_audio_device()
void
update_device_widget(gchar *pluginName)
{
if (g_strcasecmp(pluginName, "default") == 0) {
if (utf8_case_cmp(pluginName, "default") == 0) {
gtk_widget_set_sensitive(output, FALSE);
gtk_widget_set_sensitive(input, FALSE);
gtk_widget_set_sensitive(ringtone, FALSE);
......@@ -314,7 +315,7 @@ select_active_output_audio_plugin()
do {
gtk_tree_model_get(model, &iter, 0, &pluginname, -1);
if (g_strcasecmp(tmp, pluginname) == 0) {
if (utf8_case_cmp(tmp, pluginname) == 0) {
// Set current iteration the active one
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(plugin), &iter);
return;
......@@ -421,11 +422,11 @@ codec_active_toggled(GtkCellRendererToggle *renderer UNUSED, gchar *path, gpoint
codec_t* codec;
if ((g_strcasecmp(name,"speex") == 0) && (g_strcasecmp(srate,"8 kHz") == 0))
if ((utf8_case_cmp(name,"speex") == 0) && (utf8_case_cmp(srate,"8 kHz") == 0))
codec = codec_list_get_by_payload((gconstpointer) 110, acc->codecs);
else if ((g_strcasecmp(name,"speex") ==0) && (g_strcasecmp(srate,"16 kHz") ==0))
else if ((utf8_case_cmp(name,"speex") ==0) && (utf8_case_cmp(srate,"16 kHz") ==0))
codec = codec_list_get_by_payload((gconstpointer) 111, acc->codecs);
else if ((g_strcasecmp(name,"speex") ==0) && (g_strcasecmp(srate,"32 kHz") ==0))
else if ((utf8_case_cmp(name,"speex") ==0) && (utf8_case_cmp(srate,"32 kHz") ==0))
codec = codec_list_get_by_payload((gconstpointer) 112, acc->codecs);
else
codec = codec_list_get_by_name((gconstpointer) name, acc->codecs);
......
......@@ -29,6 +29,7 @@
*/
#include <glib/gi18n.h>
#include "str_utils.h"
#include "hooks-config.h"
#include "dbus.h"
......@@ -156,7 +157,7 @@ GtkWidget* create_hooks_settings()
gtk_table_attach(GTK_TABLE(table), info_bar, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 10, 10);
widg = gtk_check_button_new_with_mnemonic(_("Trigger on specific _SIP header"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), (g_strcasecmp(_urlhook_config->sip_enabled, "true") ==0) ?TRUE:FALSE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), (utf8_case_cmp(_urlhook_config->sip_enabled, "true") ==0) ?TRUE:FALSE);
g_signal_connect(G_OBJECT(widg) , "clicked" , G_CALLBACK(sip_enabled_cb), NULL);
gtk_table_attach(GTK_TABLE(table), widg, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......@@ -165,7 +166,7 @@ GtkWidget* create_hooks_settings()
gtk_table_attach(GTK_TABLE(table), field, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
widg = gtk_check_button_new_with_mnemonic(_("Trigger on _IAX2 URL"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), (g_strcasecmp(_urlhook_config->iax2_enabled, "true") ==0) ?TRUE:FALSE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), (utf8_case_cmp(_urlhook_config->iax2_enabled, "true") ==0) ?TRUE:FALSE);
g_signal_connect(G_OBJECT(widg) , "clicked" , G_CALLBACK(iax2_enabled_cb), NULL);
gtk_table_attach(GTK_TABLE(table), widg, 0, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......@@ -177,14 +178,12 @@ GtkWidget* create_hooks_settings()
gtk_entry_set_text(GTK_ENTRY(command), _urlhook_config->command);
gtk_table_attach(GTK_TABLE(table), command, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10);
gnome_main_section_new_with_table(_("Phone number rewriting"), &frame, &table, 4, 2);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
gtk_widget_show(frame);
widg = gtk_check_button_new_with_mnemonic(_("_Prefix dialed numbers with"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), (g_strcasecmp(_urlhook_config->phone_number_enabled, "true") ==0) ?TRUE:FALSE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), (utf8_case_cmp(_urlhook_config->phone_number_enabled, "true") ==0) ?TRUE:FALSE);
g_signal_connect(G_OBJECT(widg) , "clicked" , G_CALLBACK(phone_number_enabled_cb), NULL);
gtk_table_attach(GTK_TABLE(table), widg, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......
......@@ -28,9 +28,10 @@
* as that of the covered work.
*/
#include <tlsadvanceddialog.h>
#include <sflphone_const.h>
#include <utils.h>
#include "tlsadvanceddialog.h"
#include "str_utils.h"
#include "sflphone_const.h"
#include "utils.h"
#include <dbus.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
......@@ -237,7 +238,7 @@ void show_advanced_tls_options(GHashTable * properties)
GtkWidget * tlsTimeOutSec;
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
tlsTimeOutSec = gtk_spin_button_new_with_range(0, pow(2,sizeof(long)), 1);
tlsTimeOutSec = gtk_spin_button_new_with_range(0, pow(2, sizeof(long)), 1);
gtk_label_set_mnemonic_widget(GTK_LABEL(label), tlsTimeOutSec);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(tlsTimeOutSec), g_ascii_strtod(negotiation_timeout_sec, NULL));
gtk_box_pack_start(GTK_BOX(hbox), tlsTimeOutSec, TRUE, TRUE, 0);
......@@ -250,19 +251,19 @@ void show_advanced_tls_options(GHashTable * properties)
GtkWidget * verifyCertificateServer;
verifyCertificateServer = gtk_check_button_new_with_mnemonic(_("Verify incoming certificates, as a server"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateServer),
g_strcasecmp(verify_server,"true") == 0 ? TRUE: FALSE);
utf8_case_cmp(verify_server,"true") == 0);
gtk_table_attach(GTK_TABLE(table), verifyCertificateServer, 0, 1, 11, 12, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
GtkWidget * verifyCertificateClient;
verifyCertificateClient = gtk_check_button_new_with_mnemonic(_("Verify certificates from answer, as a client"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateClient),
g_strcasecmp(verify_client,"true") == 0 ? TRUE: FALSE);
utf8_case_cmp(verify_client,"true") == 0);
gtk_table_attach(GTK_TABLE(table), verifyCertificateClient, 0, 1, 12, 13, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
GtkWidget * requireCertificate;
requireCertificate = gtk_check_button_new_with_mnemonic(_("Require certificate for incoming tls connections"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(requireCertificate),
g_strcasecmp(require_client_certificate,"true") == 0 ? TRUE: FALSE);
utf8_case_cmp(require_client_certificate,"true") == 0);
gtk_table_attach(GTK_TABLE(table), requireCertificate, 0, 1, 13, 14, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show_all(ret);
......
......@@ -30,6 +30,7 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "str_utils.h"
#include <zrtpadvanceddialog.h>
#include "sflphone_const.h"
#include "utils.h"
......@@ -42,10 +43,10 @@ void show_advanced_zrtp_options(GHashTable * properties)
gboolean curDisplaySasOnce = FALSE;
if (properties != NULL) {
curHelloEnabled = !g_strcasecmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_HELLO_HASH), "true");
curSasConfirm = !g_strcasecmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_DISPLAY_SAS), "true");
curZrtpNotSuppOther = !g_strcasecmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING), "true");
curDisplaySasOnce = !g_strcasecmp(g_hash_table_lookup(properties, ACCOUNT_DISPLAY_SAS_ONCE), "true");
curHelloEnabled = !utf8_case_cmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_HELLO_HASH), "true");
curSasConfirm = !utf8_case_cmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_DISPLAY_SAS), "true");
curZrtpNotSuppOther = !utf8_case_cmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING), "true");
curDisplaySasOnce = !utf8_case_cmp(g_hash_table_lookup(properties, ACCOUNT_DISPLAY_SAS_ONCE), "true");
}
GtkDialog *securityDialog = GTK_DIALOG(gtk_dialog_new_with_buttons(_("ZRTP Options"),
......@@ -118,7 +119,7 @@ void show_advanced_sdes_options(GHashTable * properties)
gboolean rtpFallback = FALSE;
if (properties != NULL) {
rtpFallback = !g_strcasecmp(g_hash_table_lookup(properties, ACCOUNT_SRTP_RTP_FALLBACK), "true");
rtpFallback = !utf8_case_cmp(g_hash_table_lookup(properties, ACCOUNT_SRTP_RTP_FALLBACK), "true");
}
GtkDialog *securityDialog = GTK_DIALOG(gtk_dialog_new_with_buttons(_("SDES Options"),
......
......@@ -29,6 +29,7 @@
*/
#include "calllist.h"
#include "str_utils.h"
#include <string.h>
#include "calltab.h"
#include "calltree.h"
......@@ -44,7 +45,7 @@ gint is_callID_callstruct(gconstpointer a, gconstpointer b)
if (c == NULL || c->type != HIST_CALL)
return 1;
return g_strcasecmp(c->elem.call->_callID, (const gchar *) b);
return utf8_case_cmp(c->elem.call->_callID, (const gchar *) b);
}
// TODO : try to do this more generically
......
......@@ -31,6 +31,7 @@
#include "calltab.h"
#include <gtk/gtk.h>
#include <stdlib.h>
#include "str_utils.h"
#include "calltree.h"
#include "contacts/searchbar.h"
#include "logger.h"
......@@ -97,9 +98,9 @@ calltab_create_searchbar(calltab_t* tab)
{
g_assert(tab);
if (g_strcasecmp(tab->_name, HISTORY) == 0)
if (utf8_case_cmp(tab->_name, HISTORY) == 0)
tab->searchbar = history_searchbar_new();
else if (g_strcasecmp(tab->_name, CONTACTS) == 0)
else if (utf8_case_cmp(tab->_name, CONTACTS) == 0)
tab->searchbar = contacts_searchbar_new();
else
ERROR("Current calls tab does not need a searchbar\n");
......
......@@ -32,6 +32,7 @@
#include "calllist.h"
#include "calltree.h"