[ekiga] Use glib's g_strcmp0 instead of strcmp



commit c859d18bfe4739b4c7a7b83c782d12b0f022128d
Author: Julien Puydt <jpuydt free fr>
Date:   Sun Jan 13 22:24:23 2013 +0100

    Use glib's g_strcmp0 instead of strcmp

 lib/engine/gui/gtk-core/codecsbox.cpp              |    2 +-
 lib/engine/gui/gtk-core/form-dialog-gtk.cpp        |    6 +++---
 lib/engine/gui/gtk-frontend/call-window.cpp        |    4 ++--
 lib/engine/gui/gtk-frontend/preferences-window.cpp |    6 +++---
 lib/engine/gui/gtk-frontend/roster-view-gtk.cpp    |    2 +-
 lib/engine/gui/gtk-frontend/statusicon.cpp         |    2 +-
 lib/gmconf/gmconf-glib.c                           |   18 +++++++++---------
 lib/gui/gm-text-smiley.c                           |    2 +-
 lib/gui/gmcallbacks.c                              |    2 +-
 lib/gui/gmconfwidgets.c                            |    8 ++++----
 lib/gui/gmwindow.c                                 |    4 ++--
 lib/gui/xvwindow.cpp                               |    5 +++--
 lib/gui/xwindow.cpp                                |    8 ++++----
 lib/toolbox.c                                      |    4 ++--
 plugins/ldap/ldap-source.cpp                       |    2 +-
 plugins/libnotify/libnotify-main.cpp               |    4 ++--
 plugins/loudmouth/loudmouth-heap-roster.cpp        |   18 +++++++++---------
 plugins/loudmouth/loudmouth-presentity.cpp         |   10 +++++-----
 src/gui/assistant.cpp                              |    6 +++---
 src/gui/conf.cpp                                   |   20 ++++++++++----------
 src/gui/statusmenu.cpp                             |    4 ++--
 21 files changed, 69 insertions(+), 68 deletions(-)
---
diff --git a/lib/engine/gui/gtk-core/codecsbox.cpp b/lib/engine/gui/gtk-core/codecsbox.cpp
index f3eef30..fdf3a1e 100644
--- a/lib/engine/gui/gtk-core/codecsbox.cpp
+++ b/lib/engine/gui/gtk-core/codecsbox.cpp
@@ -238,7 +238,7 @@ codec_moved_cb (GtkWidget *widget,
   path_str = gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL (model), 
                                                   &iter);
   tree_path = gtk_tree_path_new_from_string (path_str);
-  if (!strcmp ((gchar *) g_object_get_data (G_OBJECT (widget), "operation"), 
+  if (!g_strcmp0 ((gchar *) g_object_get_data (G_OBJECT (widget), "operation"), 
                "up"))
     gtk_tree_path_prev (tree_path);
   else
diff --git a/lib/engine/gui/gtk-core/form-dialog-gtk.cpp b/lib/engine/gui/gtk-core/form-dialog-gtk.cpp
index 5eef378..079c694 100644
--- a/lib/engine/gui/gtk-core/form-dialog-gtk.cpp
+++ b/lib/engine/gui/gtk-core/form-dialog-gtk.cpp
@@ -525,7 +525,7 @@ editable_set_add_value_activated_cb (GtkWidget *entry,
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (data));
 
   value = gtk_entry_get_text (GTK_ENTRY (entry));
-  if (!strcmp (value, ""))
+  if (!g_strcmp0 (value, ""))
     return;
 
   if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) {
@@ -535,7 +535,7 @@ editable_set_add_value_activated_cb (GtkWidget *entry,
       gtk_tree_model_get (GTK_TREE_MODEL (model), &iter,
                           EditableSetSubmitter::COLUMN_VALUE, &tree_value,
                           -1);
-      if (tree_value && !strcmp (tree_value, value)) {
+      if (tree_value && !g_strcmp0 (tree_value, value)) {
         g_free (tree_value);
         return;
       }
@@ -560,7 +560,7 @@ static void
 editable_set_add_value_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
 				   gpointer data)
 {
-  if (strcmp (gtk_entry_get_text (GTK_ENTRY (data)), ""))
+  if (g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (data)), ""))
     gtk_widget_activate (GTK_WIDGET (data));
 }
 
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index 63162ee..8508050 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -2187,7 +2187,7 @@ ekiga_call_window_transfer_dialog_run (EkigaCallWindow *cw,
   gtk_dialog_set_default_response (GTK_DIALOG (cw->priv->transfer_call_popup),
 				   GTK_RESPONSE_ACCEPT);
 
-  if (u && !strcmp (u, ""))
+  if (u && !g_strcmp0 (u, ""))
     gm_entry_dialog_set_text (GM_ENTRY_DIALOG (cw->priv->transfer_call_popup), u);
   else
     gm_entry_dialog_set_text (GM_ENTRY_DIALOG (cw->priv->transfer_call_popup), "sip:");
@@ -2200,7 +2200,7 @@ ekiga_call_window_transfer_dialog_run (EkigaCallWindow *cw,
   case GTK_RESPONSE_ACCEPT:
 
     forward_url = gm_entry_dialog_get_text (GM_ENTRY_DIALOG (cw->priv->transfer_call_popup));
-    if (strcmp (forward_url, "") && cw->priv->current_call)
+    if (g_strcmp0 (forward_url, "") && cw->priv->current_call)
       cw->priv->current_call->transfer (forward_url);
     break;
 
diff --git a/lib/engine/gui/gtk-frontend/preferences-window.cpp b/lib/engine/gui/gtk-frontend/preferences-window.cpp
index 2d556ad..447e104 100644
--- a/lib/engine/gui/gtk-frontend/preferences-window.cpp
+++ b/lib/engine/gui/gtk-frontend/preferences-window.cpp
@@ -669,7 +669,7 @@ gm_pw_init_h323_page (GtkWidget *prefs_window,
 
   entry =
     gnome_prefs_entry_new (subsection, _("Forward _URI:"), H323_KEY "forward_host", _("The host where calls should be forwarded if call forwarding is enabled"), 1, false);
-  if (!strcmp (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
+  if (!g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
     gtk_entry_set_text (GTK_ENTRY (entry), "h323:");
 
   /* Packing widget */
@@ -717,7 +717,7 @@ gm_pw_init_sip_page (GtkWidget *prefs_window,
 
   entry =
     gnome_prefs_entry_new (subsection, _("Forward _URI:"), SIP_KEY "forward_host", _("The host where calls should be forwarded if call forwarding is enabled"), 1, false);
-  if (!strcmp (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
+  if (!g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
     gtk_entry_set_text (GTK_ENTRY (entry), "sip:");
 
   /* Packing widget */
@@ -1018,7 +1018,7 @@ audioev_filename_browse_cb (GtkWidget *b,
       if (filename) {
         sound_event = gm_conf_get_string (conf_key);
 
-        if (!sound_event || strcmp (filename, sound_event))
+        if (!sound_event || g_strcmp0 (filename, sound_event))
           gm_conf_set_string (conf_key, (gchar *) filename);
 
         g_free (filename);
diff --git a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
index 2a96d70..b8b3053 100644
--- a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
@@ -1033,7 +1033,7 @@ on_presentity_added (RosterViewGtk* self,
                         -1);
     if (old_presence && presentity->get_presence () != old_presence
         && presentity->get_presence () != "unknown" && presentity->get_presence () != "offline"
-        && (!strcmp (old_presence, "unknown") || !strcmp (old_presence, "offline"))) {
+        && (!g_strcmp0 (old_presence, "unknown") || !g_strcmp0 (old_presence, "offline"))) {
 
       StatusIconInfo *info = new StatusIconInfo ();
       info->model = GTK_TREE_MODEL (self->priv->store);
diff --git a/lib/engine/gui/gtk-frontend/statusicon.cpp b/lib/engine/gui/gtk-frontend/statusicon.cpp
index 44d19dd..55c5907 100644
--- a/lib/engine/gui/gtk-frontend/statusicon.cpp
+++ b/lib/engine/gui/gtk-frontend/statusicon.cpp
@@ -524,7 +524,7 @@ statusicon_should_run (void)
 
   /* Print the results */
   for (name_list_ptr = name_list; *name_list_ptr; name_list_ptr++) {
-    if (!strcmp (*name_list_ptr, "org.gnome.Shell")) {
+    if (!g_strcmp0 (*name_list_ptr, "org.gnome.Shell")) {
       shell_running = true;
       break;
     }
diff --git a/lib/gmconf/gmconf-glib.c b/lib/gmconf/gmconf-glib.c
index e1e133f..b2dfe64 100644
--- a/lib/gmconf/gmconf-glib.c
+++ b/lib/gmconf/gmconf-glib.c
@@ -746,13 +746,13 @@ sch_parser_start_element (G_GNUC_UNUSED GMarkupParseContext *context,
 
   parser = (SchParser *)data;
   parser->state = START; /* default */
-  if (strcmp (element_name, "schema") == 0)
+  if (g_strcmp0 (element_name, "schema") == 0)
     parser->entry = entry_new ();
-  else if (strcmp (element_name, "applyto") == 0)
+  else if (g_strcmp0 (element_name, "applyto") == 0)
     parser->state = KEY;
-  else if (strcmp (element_name, "type") == 0)
+  else if (g_strcmp0 (element_name, "type") == 0)
     parser->state = TYPE;
-  else if (strcmp (element_name, "default") == 0)
+  else if (g_strcmp0 (element_name, "default") == 0)
     parser->state = VALUE;
 }
 
@@ -768,7 +768,7 @@ sch_parser_end_element (G_GNUC_UNUSED GMarkupParseContext *context,
 
   parser = (SchParser *)data;
 
-  if (strcmp (element_name, "schema") == 0) {
+  if (g_strcmp0 (element_name, "schema") == 0) {
     database_add_entry (parser->db, parser->entry);
     parser->entry = NULL;
   }
@@ -799,13 +799,13 @@ sch_parser_characters (G_GNUC_UNUSED GMarkupParseContext *context,
     entry_set_key (parser->entry, text);
     break;
   case TYPE:
-    if (strcmp (text, "bool") == 0)
+    if (g_strcmp0 (text, "bool") == 0)
       entry_set_type (parser->entry, GM_CONF_BOOL);
-    else if (strcmp (text, "int") == 0)
+    else if (g_strcmp0 (text, "int") == 0)
       entry_set_type (parser->entry, GM_CONF_INT);
-    else if (strcmp (text, "string") == 0)
+    else if (g_strcmp0 (text, "string") == 0)
       entry_set_type (parser->entry, GM_CONF_STRING);
-    else if (strcmp (text, "list") == 0)
+    else if (g_strcmp0 (text, "list") == 0)
       entry_set_type (parser->entry, GM_CONF_LIST);
     else
       entry_set_type (parser->entry, GM_CONF_OTHER);
diff --git a/lib/gui/gm-text-smiley.c b/lib/gui/gm-text-smiley.c
index 216f273..d9a2194 100644
--- a/lib/gui/gm-text-smiley.c
+++ b/lib/gui/gm-text-smiley.c
@@ -135,7 +135,7 @@ enhancer_helper_enhance (G_GNUC_UNUSED GmTextBufferEnhancerHelper* self,
        smileys[ii] != NULL;
        ii = ii + 2) {
 
-    if (strcmp (smiley, smileys[ii]) == 0)
+    if (g_strcmp0 (smiley, smileys[ii]) == 0)
       pixbuf_name = smileys[ii + 1];
   }
 
diff --git a/lib/gui/gmcallbacks.c b/lib/gui/gmcallbacks.c
index 3cfb7ad..f210fd0 100644
--- a/lib/gui/gmcallbacks.c
+++ b/lib/gui/gmcallbacks.c
@@ -116,7 +116,7 @@ GNU GPL for all the rest of the software thus combined.")
   /* Translators: Please write translator credits here, and
    * separate names with \n */
   const gchar *translator_credits = _("translator-credits");
-  if (strcmp (translator_credits, "translator-credits") == 0)
+  if (g_strcmp0 (translator_credits, "translator-credits") == 0)
     translator_credits = "No translators, English by\n"
         "Damien Sandras <dsandras seconix com>";
 
diff --git a/lib/gui/gmconfwidgets.c b/lib/gui/gmconfwidgets.c
index 7082631..2a02b43 100644
--- a/lib/gui/gmconfwidgets.c
+++ b/lib/gui/gmconfwidgets.c
@@ -80,7 +80,7 @@ entry_focus_changed (GtkWidget  *w,
   current_value = gm_conf_get_string (key);
 
   if (!current_value 
-      || strcmp (current_value, gtk_entry_get_text (GTK_ENTRY (w)))) {
+      || g_strcmp0 (current_value, gtk_entry_get_text (GTK_ENTRY (w)))) {
 
     gm_conf_set_string (key, (gchar *)gtk_entry_get_text (GTK_ENTRY (w)));
   }
@@ -110,7 +110,7 @@ entry_changed_nt (G_GNUC_UNUSED gpointer cid,
     current_value = gm_conf_entry_get_string (entry);
 
     if (current_value
-	&& strcmp (current_value, gtk_entry_get_text (GTK_ENTRY (e)))) {
+	&& g_strcmp0 (current_value, gtk_entry_get_text (GTK_ENTRY (e)))) {
 
       g_signal_handlers_block_matched (G_OBJECT (e),
 				       G_SIGNAL_MATCH_FUNC,
@@ -333,7 +333,7 @@ string_option_menu_changed (GtkWidget *option_menu,
     gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 0, &text, -1);
     current_value = gm_conf_get_string (key);
 
-    if (text && current_value && strcmp (text, current_value))
+    if (text && current_value && g_strcmp0 (text, current_value))
       gm_conf_set_string (key, text);
 
     g_free (text);
@@ -377,7 +377,7 @@ string_option_menu_changed_nt (G_GNUC_UNUSED gpointer cid,
 
       gtk_tree_model_get (model, &iter, 0, &text, -1);
       txt = gm_conf_entry_get_string (entry);
-      if (text && !strcmp (text, txt)) {
+      if (text && !g_strcmp0 (text, txt)) {
 
         g_free (text);
         g_free (txt);
diff --git a/lib/gui/gmwindow.c b/lib/gui/gmwindow.c
index 49f1cd8..95ec508 100644
--- a/lib/gui/gmwindow.c
+++ b/lib/gui/gmwindow.c
@@ -279,7 +279,7 @@ window_show_cb (GtkWidget *w,
 
   self = GM_WINDOW (w);
 
-  g_return_if_fail (strcmp (self->priv->key, ""));
+  g_return_if_fail (g_strcmp0 (self->priv->key, ""));
 
   conf_key_position =
     g_strdup_printf ("%s/position", self->priv->key);
@@ -343,7 +343,7 @@ window_hide_cb (GtkWidget *w,
 
   self = GM_WINDOW (w);
 
-  g_return_if_fail (strcmp (self->priv->key, ""));
+  g_return_if_fail (g_strcmp0 (self->priv->key, ""));
 
   conf_key_position =
     g_strdup_printf ("%s/position", self->priv->key);
diff --git a/lib/gui/xvwindow.cpp b/lib/gui/xvwindow.cpp
index e9b57cd..093af26 100644
--- a/lib/gui/xvwindow.cpp
+++ b/lib/gui/xvwindow.cpp
@@ -38,6 +38,7 @@
 
 #include "xvwindow.h"
 
+#include <glib.h>
 #include <ptlib/object.h>
 
 #define GUID_I420_PLANAR 0x30323449
@@ -557,7 +558,7 @@ XVWindow::GetXVAtom ( char const * name )
   
     for ( i = 0; i < numAttributes; ++i ) {
 
-      if ( strcmp(attributes[i].name, name ) == 0 ) {
+      if ( g_strcmp0(attributes[i].name, name ) == 0 ) {
 
         atom = XInternAtom( _display, name, False );
         break; 
@@ -624,7 +625,7 @@ XVWindow::checkMaxSize(unsigned int width, unsigned int height)
 
   for (i = 0 ; i < numXveinfo ; i++) {
 
-    if ( strcmp( xveinfo[i].name, "XV_IMAGE" ) == 0 ) {
+    if (g_strcmp0( xveinfo[i].name, "XV_IMAGE" ) == 0) {
 
       if ( (width <= xveinfo[i].width  ) ||
            (height <= xveinfo[i].height) )
diff --git a/lib/gui/xwindow.cpp b/lib/gui/xwindow.cpp
index eb7a87f..98100ad 100644
--- a/lib/gui/xwindow.cpp
+++ b/lib/gui/xwindow.cpp
@@ -238,23 +238,23 @@ XWindow::Init (Display* dp,
   _planes = xFormat->planes;
 
 #ifdef WORDS_BIGENDIAN
-  if (strcmp (xFormat->name, "BGRA") == 0) {
+  if (g_strcmp0 (xFormat->name, "BGRA") == 0) {
     snprintf (_colorFormat, sizeof(_colorFormat), "RGB32");
     _outOffset = 1;
     _planes = 4;
   } 
-  if (strcmp (xFormat->name, "RGBA") == 0) {
+  if (g_strcmp0 (xFormat->name, "RGBA") == 0) {
     snprintf (_colorFormat, sizeof(_colorFormat), "BGR32");
     _outOffset = 1;
     _planes = 4;
   } 
 #else
-  if (strcmp (xFormat->name, "ABGR") == 0) {
+  if (g_strcmp0 (xFormat->name, "ABGR") == 0) {
     snprintf (_colorFormat, sizeof(_colorFormat), "BGR32");
     _outOffset = -1;
     _planes = 4;
   } 
-  if (strcmp (xFormat->name, "ARGB") == 0) {
+  if (g_strcmp0 (xFormat->name, "ARGB") == 0) {
     snprintf (_colorFormat, sizeof(_colorFormat), "RGB32");
     _outOffset = -1;
     _planes = 4;
diff --git a/lib/toolbox.c b/lib/toolbox.c
index 0c3c02d..e339c03 100644
--- a/lib/toolbox.c
+++ b/lib/toolbox.c
@@ -141,8 +141,8 @@ GSList
 	       seenlist_iter = g_slist_next (seenlist_iter))
 	    {
 	      if (seenlist_iter->data &&
-		  !strcmp ((const char*) origlist_iter->data,
-			   (const char*) seenlist_iter->data))
+		  !g_strcmp0 ((const char*) origlist_iter->data,
+			      (const char*) seenlist_iter->data))
 		  seen = TRUE;
 	    }
 	  if (!seen)
diff --git a/plugins/ldap/ldap-source.cpp b/plugins/ldap/ldap-source.cpp
index 8a7923a..b934b36 100644
--- a/plugins/ldap/ldap-source.cpp
+++ b/plugins/ldap/ldap-source.cpp
@@ -53,7 +53,7 @@ OPENLDAP::Source::Source (Ekiga::ServiceCore &_core):
   xmlNodePtr root;
   gchar *c_raw = gm_conf_get_string (KEY);
 
-  if (c_raw != NULL && strcmp (c_raw, "")) {
+  if (c_raw != NULL && g_strcmp0 (c_raw, "")) {
 
     const std::string raw = c_raw;
 
diff --git a/plugins/libnotify/libnotify-main.cpp b/plugins/libnotify/libnotify-main.cpp
index b4ea8f2..ce05e9a 100644
--- a/plugins/libnotify/libnotify-main.cpp
+++ b/plugins/libnotify/libnotify-main.cpp
@@ -89,7 +89,7 @@ call_notification_action_cb (NotifyNotification *notification,
   Ekiga::Call *call = (Ekiga::Call *) data;
 
   notify_notification_close (notification, NULL);
-  if (!strcmp (action, "accept"))
+  if (!g_strcmp0 (action, "accept"))
     call->answer ();
   else
     call->hang_up ();
@@ -155,7 +155,7 @@ LibNotify::LibNotify (Ekiga::ServiceCore& core)
   GList *capabilities = notify_get_server_caps ();
   if (capabilities != NULL) {
     for (GList *c = capabilities ; c != NULL ; c = c->next) {
-      if (strcmp ((char*)c->data, "actions") == 0 ) {
+      if (g_strcmp0 ((char*)c->data, "actions") == 0 ) {
 
 	has_actions=true;
 	break;
diff --git a/plugins/loudmouth/loudmouth-heap-roster.cpp b/plugins/loudmouth/loudmouth-heap-roster.cpp
index afeac49..7cce94a 100644
--- a/plugins/loudmouth/loudmouth-heap-roster.cpp
+++ b/plugins/loudmouth/loudmouth-heap-roster.cpp
@@ -122,7 +122,7 @@ LM::HeapRoster::handle_iq (LmConnection* /*connection*/,
     if (node != NULL) {
 
       const gchar* xmlns = lm_message_node_get_attribute (node, "xmlns");
-      if (xmlns != NULL && strcmp (xmlns, "jabber:iq:roster") == 0) {
+      if (xmlns != NULL && g_strcmp0 (xmlns, "jabber:iq:roster") == 0) {
 
 	parse_roster (node);
 	result = LM_HANDLER_RESULT_REMOVE_MESSAGE;
@@ -153,7 +153,7 @@ LM::HeapRoster::handle_presence (LmConnection* /*connection*/,
 
   PresentityPtr item = find_item (base_jid);
 
-  if (type_attr != NULL && strcmp (type_attr, "subscribe") == 0) {
+  if (type_attr != NULL && g_strcmp0 (type_attr, "subscribe") == 0) {
 
     result = LM_HANDLER_RESULT_REMOVE_MESSAGE;
     boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new Ekiga::FormRequestSimple (boost::bind (&LM::HeapRoster::subscribe_from_form_submitted, this, _1, _2)));
@@ -224,8 +224,8 @@ LM::HeapRoster::handle_message (LmConnection* /*connection*/,
   PresentityPtr item = find_item (base_jid);
 
   if (item && (type_attr == NULL
-	       || (type_attr != NULL && strcmp (type_attr, "normal") == 0)
-	       || (type_attr != NULL && strcmp (type_attr, "chat") == 0))) {
+	       || (type_attr != NULL && g_strcmp0 (type_attr, "normal") == 0)
+	       || (type_attr != NULL && g_strcmp0 (type_attr, "chat") == 0))) {
 
     // let's imagine it's a basic chat message
     LmMessageNode* body = lm_message_node_find_child (node, "body");
@@ -251,7 +251,7 @@ LM::HeapRoster::handle_initial_roster_reply (LmConnection* /*connection*/,
     if (node != NULL) {
 
       const gchar* xmlns = lm_message_node_get_attribute (node, "xmlns");
-      if (xmlns != NULL && strcmp (xmlns, "jabber:iq:roster") == 0) {
+      if (xmlns != NULL && g_strcmp0 (xmlns, "jabber:iq:roster") == 0) {
 
 	parse_roster (node);
 	result = LM_HANDLER_RESULT_REMOVE_MESSAGE;
@@ -267,7 +267,7 @@ LM::HeapRoster::parse_roster (LmMessageNode* query)
 {
   for (LmMessageNode* node = query->children; node != NULL; node = node->next) {
 
-    if (strcmp (node->name, "item") != 0) {
+    if (g_strcmp0 (node->name, "item") != 0) {
 
       continue;
     }
@@ -280,7 +280,7 @@ LM::HeapRoster::parse_roster (LmMessageNode* query)
 
 	found = true;
 	const gchar* subscription = lm_message_node_get_attribute (node, "subscription");
-	if (subscription != NULL && strcmp (subscription, "remove") == 0) {
+	if (subscription != NULL && g_strcmp0 (subscription, "remove") == 0) {
 
 	  (*iter)->removed ();
 	} else {
@@ -295,10 +295,10 @@ LM::HeapRoster::parse_roster (LmMessageNode* query)
       presentity->chat_requested.connect (boost::bind (&LM::HeapRoster::on_chat_requested, this, presentity));
       add_presentity (presentity);
       const gchar* subscription = lm_message_node_get_attribute (node, "subscription");
-      if (subscription != NULL && strcmp (subscription, "none") == 0) {
+      if (subscription != NULL && g_strcmp0 (subscription, "none") == 0) {
 
 	const gchar* ask = lm_message_node_get_attribute (node, "ask");
-	if (ask == NULL || (ask != NULL && strcmp (ask, "subscribe") != 0)) {
+	if (ask == NULL || (ask != NULL && g_strcmp0 (ask, "subscribe") != 0)) {
 
 	  std::set<std::string>::iterator iter = items_added_by_me.find (presentity->get_jid ());
 	  if (iter != items_added_by_me.end ()) {
diff --git a/plugins/loudmouth/loudmouth-presentity.cpp b/plugins/loudmouth/loudmouth-presentity.cpp
index 7d4bc02..4181a37 100644
--- a/plugins/loudmouth/loudmouth-presentity.cpp
+++ b/plugins/loudmouth/loudmouth-presentity.cpp
@@ -139,7 +139,7 @@ LM::Presentity::get_groups () const
 
   for (LmMessageNode* node = item->children; node != NULL; node = node->next) {
 
-    if (strcmp (node->name, "group") == 0) {
+    if (g_strcmp0 (node->name, "group") == 0) {
 
       if (node->value) {
 
@@ -169,11 +169,11 @@ LM::Presentity::populate_menu (Ekiga::MenuBuilder& builder)
   builder.add_action ("edit", _("_Edit"),
 		      boost::bind (&LM::Presentity::edit_presentity, this));
 
-  if (strcmp (subscription, "none") == 0) {
+  if (g_strcmp0 (subscription, "none") == 0) {
 
     builder.add_action ("ask", _("Ask him/her to see his/her status"), boost::bind (&LM::Presentity::ask_to, this));
   }
-  if (strcmp (subscription, "from") == 0) {
+  if (g_strcmp0 (subscription, "from") == 0) {
 
     builder.add_action ("stop", _("Forbid him/her to see my status"), boost::bind (&LM::Presentity::revoke_from, this));
     if (ask == NULL)
@@ -181,11 +181,11 @@ LM::Presentity::populate_menu (Ekiga::MenuBuilder& builder)
     else
       builder.add_ghost ("ask", _("Ask him/her to see his/her status (pending)"));
   }
-  if (strcmp (subscription, "to") == 0) {
+  if (g_strcmp0 (subscription, "to") == 0) {
 
     builder.add_action ("stop", _("Stop getting his/her status"), boost::bind (&LM::Presentity::stop_to, this));
   }
-  if (strcmp (subscription, "both") == 0) {
+  if (g_strcmp0 (subscription, "both") == 0) {
 
     builder.add_action ("stop", _("Forbid him/her to see my status"), boost::bind (&LM::Presentity::revoke_from, this));
     builder.add_action ("stop", _("Stop getting his/her status"), boost::bind (&LM::Presentity::stop_to, this));
diff --git a/src/gui/assistant.cpp b/src/gui/assistant.cpp
index 347e66e..1ed0dd5 100644
--- a/src/gui/assistant.cpp
+++ b/src/gui/assistant.cpp
@@ -173,7 +173,7 @@ update_combo_box (GtkComboBox         *combo_box,
 
   selected = 0;
   for (i = 0; options[i]; i++) {
-    if (default_value && strcmp (options[i], default_value) == 0)
+    if (default_value && g_strcmp0 (options[i], default_value) == 0)
       selected = i;
 
     gtk_list_store_append (GTK_LIST_STORE (model), &iter);
@@ -571,7 +571,7 @@ ekiga_net_info_changed_cb (G_GNUC_UNUSED GtkWidget *w,
   else {
     const char *username = gtk_entry_get_text (GTK_ENTRY (assistant->priv->username));
     const char *password = gtk_entry_get_text (GTK_ENTRY (assistant->priv->password));
-    complete = strcmp(username, "") != 0 && strcmp(password, "") != 0;
+    complete = g_strcmp0(username, "") != 0 && g_strcmp0(password, "") != 0;
   }
 
   set_current_page_complete (GTK_ASSISTANT (assistant), complete);
@@ -589,7 +589,7 @@ ekiga_out_info_changed_cb (G_GNUC_UNUSED GtkWidget *w,
   else {
     const char *username = gtk_entry_get_text (GTK_ENTRY (assistant->priv->dusername));
     const char *password = gtk_entry_get_text (GTK_ENTRY (assistant->priv->dpassword));
-    complete = strcmp(username, "") != 0 && strcmp(password, "") != 0;
+    complete = g_strcmp0(username, "") != 0 && g_strcmp0(password, "") != 0;
   }
 
   set_current_page_complete (GTK_ASSISTANT (assistant), complete);
diff --git a/src/gui/conf.cpp b/src/gui/conf.cpp
index a95cd9e..14a9eb7 100644
--- a/src/gui/conf.cpp
+++ b/src/gui/conf.cpp
@@ -58,7 +58,7 @@ gnomemeeting_conf_upgrade ()
   gchar *conf_url = gm_conf_get_string ("/desktop/gnome/url-handlers/callto/command");
 
   if (!conf_url
-      || !strcmp (conf_url, "gnomemeeting -c \"%s\"")) {
+      || !g_strcmp0 (conf_url, "gnomemeeting -c \"%s\"")) {
 
     gm_conf_set_string ("/desktop/gnome/url-handlers/callto/command",
 			"ekiga -c \"%s\"");
@@ -72,7 +72,7 @@ gnomemeeting_conf_upgrade ()
 
   conf_url = gm_conf_get_string ("/desktop/gnome/url-handlers/h323/command");
   if (!conf_url
-      || !strcmp (conf_url, "gnomemeeting -c \"%s\"")) {
+      || !g_strcmp0 (conf_url, "gnomemeeting -c \"%s\"")) {
 
     gm_conf_set_string ("/desktop/gnome/url-handlers/h323/command",
                         "ekiga -c \"%s\"");
@@ -85,7 +85,7 @@ gnomemeeting_conf_upgrade ()
 
   conf_url = gm_conf_get_string ("/desktop/gnome/url-handlers/sip/command");
   if (!conf_url
-      || !strcmp (conf_url, "gnomemeeting -c \"%s\"")) {
+      || !g_strcmp0 (conf_url, "gnomemeeting -c \"%s\"")) {
 
     gm_conf_set_string ("/desktop/gnome/url-handlers/sip/command",
                         "ekiga -c \"%s\"");
@@ -98,13 +98,13 @@ gnomemeeting_conf_upgrade ()
 
   /* New full name key */
   conf_url = gm_conf_get_string (PERSONAL_DATA_KEY "full_name");
-  if (!conf_url || (conf_url && !strcmp (conf_url, ""))) {
+  if (!conf_url || (conf_url && !g_strcmp0 (conf_url, ""))) {
 
     gchar *fullname = NULL;
     gchar *firstname = gm_conf_get_string (PERSONAL_DATA_KEY "firstname");
     gchar *lastname = gm_conf_get_string (PERSONAL_DATA_KEY "lastname");
 
-    if (firstname && lastname && strcmp (firstname, "") && strcmp (lastname, "")) {
+    if (firstname && lastname && g_strcmp0 (firstname, "") && g_strcmp0 (lastname, "")) {
       fullname = g_strdup_printf ("%s %s", firstname, lastname);
       gm_conf_set_string (PERSONAL_DATA_KEY "firstname", "");
       gm_conf_set_string (PERSONAL_DATA_KEY "lastname", "");
@@ -136,7 +136,7 @@ gnomemeeting_conf_upgrade ()
   gchar *device = NULL;
   gchar *new_device = NULL;
   plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin");
-  if (plugin && strcmp (plugin, "")) {
+  if (plugin && g_strcmp0 (plugin, "")) {
     device = gm_conf_get_string (AUDIO_DEVICES_KEY "input_device");
     new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin);
     gm_conf_set_string (AUDIO_DEVICES_KEY "plugin", "");
@@ -162,7 +162,7 @@ gnomemeeting_conf_upgrade ()
 
   /* Video devices */
   plugin = gm_conf_get_string (VIDEO_DEVICES_KEY "plugin");
-  if (plugin && strcmp (plugin, "")) {
+  if (plugin && g_strcmp0 (plugin, "")) {
     device = gm_conf_get_string (VIDEO_DEVICES_KEY "input_device");
     new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin);
     gm_conf_set_string (VIDEO_DEVICES_KEY "plugin", "");
@@ -190,9 +190,9 @@ gnomemeeting_conf_upgrade ()
 
   // migrate short_status
   gchar *ss = gm_conf_get_string (PERSONAL_DATA_KEY "short_status");
-  if (ss && !strcmp (ss, "online"))
+  if (ss && !g_strcmp0 (ss, "online"))
     gm_conf_set_string (PERSONAL_DATA_KEY "short_status", "available");
-  else if (ss && !strcmp (ss, "dnd"))
+  else if (ss && !g_strcmp0 (ss, "dnd"))
     gm_conf_set_string (PERSONAL_DATA_KEY "short_status", "busy");
   g_free (ss);
 
@@ -217,7 +217,7 @@ gnomemeeting_conf_upgrade ()
   // migrate first port in UDP port ranges from 5060 to 5061, see bug #690621
   if (version >= 0 && version <= 4000) {
     gchar *ports = gm_conf_get_string (PORTS_KEY "udp_port_range");
-    if (ports && !strncmp (ports, "5060", 4)) {
+    if (ports && !g_ascii_strncasecmp (ports, "5060", 4)) {
       ports[3] = '1';
       gm_conf_set_string (PORTS_KEY "udp_port_range", ports);
     }
diff --git a/src/gui/statusmenu.cpp b/src/gui/statusmenu.cpp
index 972d9ed..7910892 100644
--- a/src/gui/statusmenu.cpp
+++ b/src/gui/statusmenu.cpp
@@ -622,7 +622,7 @@ status_menu_clear_status_message_dialog_run (StatusMenu *self)
       gtk_tree_model_get (GTK_TREE_MODEL (list_store), &iter,
                           1, &message,
                           2, &i, -1);
-      if (status && message && !strcmp (status, message))
+      if (status && message && !g_strcmp0 (status, message))
         found = true;
 
       conf_list[i - NUM_STATUS_TYPES - 1] = g_slist_append (conf_list[i - NUM_STATUS_TYPES - 1], g_strdup (message));
@@ -697,7 +697,7 @@ status_menu_new_status_message_dialog_run (StatusMenu *self,
   case GTK_RESPONSE_ACCEPT:
     message = gtk_entry_get_text (GTK_ENTRY (entry));
     clist = gm_conf_get_string_list (status_types_keys[option - NUM_STATUS_TYPES - 1]);
-    if (message && strcmp (message, "")) {
+    if (message && g_strcmp0 (message, "")) {
       clist = g_slist_append (clist, g_strdup (message));
       gm_conf_set_string_list (status_types_keys[option - NUM_STATUS_TYPES - 1], clist);
       self->priv->personal_details->set_presence_info (status_types_names[option - NUM_STATUS_TYPES - 1], message);



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