Commit 025c9ec4 authored by Jonny Lamb's avatar Jonny Lamb Committed by Xavier Claessens

Renamed G_STR_EMPTY to EMP_STR_EMPTY.

Signed-off-by: default avatarJonny Lamb <jonny.lamb@collabora.co.uk>

svn path=/trunk/; revision=2249
parent 3db2a8f2
......@@ -51,7 +51,7 @@ account_widget_entry_focus_cb (GtkWidget *widget,
str = gtk_entry_get_text (GTK_ENTRY (widget));
param_name = g_object_get_data (G_OBJECT (widget), "param_name");
if (G_STR_EMPTY (str)) {
if (EMP_STR_EMPTY (str)) {
gchar *value = NULL;
mc_account_unset_param (account, param_name);
......@@ -154,7 +154,7 @@ account_widget_password_changed_cb (GtkWidget *entry,
const gchar *str;
str = gtk_entry_get_text (GTK_ENTRY (entry));
gtk_widget_set_sensitive (button, !G_STR_EMPTY (str));
gtk_widget_set_sensitive (button, !EMP_STR_EMPTY (str));
}
static void
......@@ -445,7 +445,7 @@ empathy_account_widget_add_forget_button (McAccount *account,
entry_password = glade_xml_get_widget (glade, entry);
mc_account_get_param_string (account, "password", &password);
gtk_widget_set_sensitive (button_forget, !G_STR_EMPTY (password));
gtk_widget_set_sensitive (button_forget, !EMP_STR_EMPTY (password));
g_free (password);
g_signal_connect (button_forget, "clicked",
......
......@@ -323,7 +323,7 @@ chat_text_view_populate_popup (EmpathyChatTextView *view,
&start, &end, FALSE);
}
if (G_STR_EMPTY (str)) {
if (EMP_STR_EMPTY (str)) {
g_free (str);
return;
}
......@@ -762,7 +762,7 @@ chat_text_view_append_event (EmpathyChatView *view,
g_return_if_fail (EMPATHY_IS_CHAT_TEXT_VIEW (view));
g_return_if_fail (!G_STR_EMPTY (str));
g_return_if_fail (!EMP_STR_EMPTY (str));
bottom = chat_text_view_is_scrolled_down (text_view);
chat_text_view_maybe_trim_buffer (EMPATHY_CHAT_TEXT_VIEW (view));
......@@ -856,7 +856,7 @@ chat_text_view_find_previous (EmpathyChatView *view,
buffer = priv->buffer;
if (G_STR_EMPTY (search_criteria)) {
if (EMP_STR_EMPTY (search_criteria)) {
if (priv->find_mark_previous) {
gtk_text_buffer_get_start_iter (buffer, &iter_at_mark);
......@@ -971,7 +971,7 @@ chat_text_view_find_next (EmpathyChatView *view,
buffer = priv->buffer;
if (G_STR_EMPTY (search_criteria)) {
if (EMP_STR_EMPTY (search_criteria)) {
if (priv->find_mark_next) {
gtk_text_buffer_get_start_iter (buffer, &iter_at_mark);
......@@ -1142,7 +1142,7 @@ chat_text_view_highlight (EmpathyChatView *view,
&iter_start,
&iter_end);
if (G_STR_EMPTY (text)) {
if (EMP_STR_EMPTY (text)) {
return;
}
......
......@@ -352,7 +352,7 @@ chat_send (EmpathyChat *chat,
priv = GET_PRIV (chat);
if (G_STR_EMPTY (msg)) {
if (EMP_STR_EMPTY (msg)) {
return;
}
......@@ -543,7 +543,7 @@ chat_property_changed_cb (EmpathyTpChat *tp_chat,
priv->subject = g_value_dup_string (value);
g_object_notify (G_OBJECT (chat), "subject");
if (G_STR_EMPTY (priv->subject)) {
if (EMP_STR_EMPTY (priv->subject)) {
gtk_widget_hide (priv->hbox_topic);
} else {
gtk_label_set_text (GTK_LABEL (priv->label_topic), priv->subject);
......@@ -552,7 +552,7 @@ chat_property_changed_cb (EmpathyTpChat *tp_chat,
if (priv->block_events_timeout_id == 0) {
gchar *str;
if (!G_STR_EMPTY (priv->subject)) {
if (!EMP_STR_EMPTY (priv->subject)) {
str = g_strdup_printf (_("Topic set to: %s"), priv->subject);
} else {
str = g_strdup (_("No topic defined"));
......@@ -987,7 +987,7 @@ chat_input_populate_popup_cb (GtkTextView *view,
/* Add the Send menu item. */
gtk_text_buffer_get_bounds (buffer, &start, &end);
str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
if (!G_STR_EMPTY (str)) {
if (!EMP_STR_EMPTY (str)) {
item = gtk_menu_item_new_with_mnemonic (_("_Send"));
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (chat_text_send_cb), chat);
......@@ -1012,7 +1012,7 @@ chat_input_populate_popup_cb (GtkTextView *view,
str = gtk_text_buffer_get_text (buffer,
&start, &end, FALSE);
}
if (!G_STR_EMPTY (str)) {
if (!EMP_STR_EMPTY (str)) {
chat_spell = chat_spell_new (chat, str, start, end);
g_object_set_data_full (G_OBJECT (menu),
"chat_spell", chat_spell,
......
......@@ -853,7 +853,7 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
priv = GET_PRIV (store);
if (G_STR_EMPTY (empathy_contact_get_name (contact)) ||
if (EMP_STR_EMPTY (empathy_contact_get_name (contact)) ||
(!priv->show_offline && !empathy_contact_is_online (contact))) {
return;
}
......
......@@ -792,7 +792,7 @@ contact_list_view_row_has_child_toggled_cb (GtkTreeModel *model,
EMPATHY_CONTACT_LIST_STORE_COL_NAME, &name,
-1);
if (!is_group || G_STR_EMPTY (name)) {
if (!is_group || EMP_STR_EMPTY (name)) {
g_free (name);
return;
}
......
......@@ -703,7 +703,7 @@ contact_widget_change_contact (EmpathyContactWidget *information)
const gchar *id;
id = gtk_entry_get_text (GTK_ENTRY (information->widget_id));
if (G_STR_EMPTY (id))
if (EMP_STR_EMPTY (id))
return;
contact = empathy_contact_factory_get_from_id (information->factory,
......@@ -979,7 +979,7 @@ contact_widget_model_find_name (EmpathyContactWidget *information,
GtkTreeModel *model;
FindName data;
if (G_STR_EMPTY (name))
if (EMP_STR_EMPTY (name))
return FALSE;
data.information = information;
......@@ -1091,7 +1091,7 @@ contact_widget_entry_group_changed_cb (GtkEditable *editable,
gtk_widget_set_sensitive (GTK_WIDGET (information->button_group), FALSE);
else
gtk_widget_set_sensitive (GTK_WIDGET (information->button_group),
!G_STR_EMPTY (group));
!EMP_STR_EMPTY (group));
}
static void
......
......@@ -290,7 +290,7 @@ log_window_entry_find_changed_cb (GtkWidget *entry,
str = gtk_entry_get_text (GTK_ENTRY (window->entry_find));
is_sensitive &= !G_STR_EMPTY (str);
is_sensitive &= !EMP_STR_EMPTY (str);
is_sensitive &=
!window->last_find ||
(window->last_find && strcmp (window->last_find, str) != 0);
......@@ -400,7 +400,7 @@ log_window_find_populate (EmpathyLogWindow *window,
gtk_list_store_clear (store);
if (G_STR_EMPTY (search_criteria)) {
if (EMP_STR_EMPTY (search_criteria)) {
/* Just clear the search. */
return;
}
......
......@@ -175,7 +175,7 @@ new_message_dialog_response_cb (GtkWidget *widget,
account = empathy_account_chooser_get_account (EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser));
id = gtk_entry_get_text (GTK_ENTRY (dialog->entry_id));
if (!account || G_STR_EMPTY (id)) {
if (!account || EMP_STR_EMPTY (id)) {
if (account) {
g_object_unref (account);
}
......@@ -209,7 +209,7 @@ new_message_change_state_button_cb (GtkEditable *editable,
gboolean sensitive;
id = gtk_entry_get_text (GTK_ENTRY (editable));
sensitive = !G_STR_EMPTY (id);
sensitive = !EMP_STR_EMPTY (id);
gtk_widget_set_sensitive (dialog->button_chat, sensitive);
gtk_widget_set_sensitive (dialog->button_call, sensitive);
......
......@@ -242,8 +242,8 @@ empathy_smiley_manager_add (EmpathySmileyManager *manager,
va_list var_args;
g_return_if_fail (EMPATHY_IS_SMILEY_MANAGER (manager));
g_return_if_fail (!G_STR_EMPTY (icon_name));
g_return_if_fail (!G_STR_EMPTY (first_str));
g_return_if_fail (!EMP_STR_EMPTY (icon_name));
g_return_if_fail (!EMP_STR_EMPTY (first_str));
smiley = empathy_pixbuf_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
if (smiley) {
......@@ -264,7 +264,7 @@ empathy_smiley_manager_add_from_pixbuf (EmpathySmileyManager *manager,
g_return_if_fail (EMPATHY_IS_SMILEY_MANAGER (manager));
g_return_if_fail (GDK_IS_PIXBUF (smiley));
g_return_if_fail (!G_STR_EMPTY (first_str));
g_return_if_fail (!EMP_STR_EMPTY (first_str));
va_start (var_args, first_str);
smiley_manager_add_valist (manager, smiley, first_str, var_args);
......
......@@ -355,7 +355,7 @@ theme_manager_ensure_theme_exists (const gchar *name)
{
gint i;
if (G_STR_EMPTY (name)) {
if (EMP_STR_EMPTY (name)) {
return FALSE;
}
......
......@@ -341,7 +341,7 @@ empathy_chatroom_get_name (EmpathyChatroom *chatroom)
priv = GET_PRIV (chatroom);
if (G_STR_EMPTY (priv->name)) {
if (EMP_STR_EMPTY (priv->name)) {
return priv->room;
}
......
......@@ -381,7 +381,7 @@ contact_is_ready (EmpathyContact *contact, EmpathyContactReady ready)
/* When the name is NULL, empathy_contact_get_name() fallback to the id.
* When the caller want to wait the name to be ready, it also want to wait
* the id to be ready in case of fallback. */
if ((ready & EMPATHY_CONTACT_READY_NAME) && G_STR_EMPTY (priv->name))
if ((ready & EMPATHY_CONTACT_READY_NAME) && EMP_STR_EMPTY (priv->name))
ready |= EMPATHY_CONTACT_READY_ID;
return (priv->ready & ready) == ready;
......@@ -508,7 +508,7 @@ empathy_contact_set_id (EmpathyContact *contact,
priv->id = g_strdup (id);
g_object_notify (G_OBJECT (contact), "id");
if (G_STR_EMPTY (priv->name))
if (EMP_STR_EMPTY (priv->name))
g_object_notify (G_OBJECT (contact), "name");
}
contact_set_ready_flag (contact, EMPATHY_CONTACT_READY_ID);
......@@ -525,7 +525,7 @@ empathy_contact_get_name (EmpathyContact *contact)
priv = GET_PRIV (contact);
if (G_STR_EMPTY (priv->name))
if (EMP_STR_EMPTY (priv->name))
return empathy_contact_get_id (contact);
return priv->name;
......@@ -940,7 +940,7 @@ contact_get_avatar_filename (EmpathyContact *contact,
gchar *token_escaped;
gchar *contact_escaped;
if (G_STR_EMPTY (priv->id))
if (EMP_STR_EMPTY (priv->id))
return NULL;
contact_escaped = tp_escape_as_identifier (priv->id);
......@@ -978,7 +978,7 @@ empathy_contact_load_avatar_data (EmpathyContact *contact,
g_return_if_fail (data != NULL);
g_return_if_fail (len > 0);
g_return_if_fail (format != NULL);
g_return_if_fail (!G_STR_EMPTY (token));
g_return_if_fail (!EMP_STR_EMPTY (token));
/* Load and set the avatar */
avatar = empathy_avatar_new (g_memdup (data, len), len, g_strdup (format),
......@@ -1013,7 +1013,7 @@ empathy_contact_load_avatar_cache (EmpathyContact *contact,
GError *error = NULL;
g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), FALSE);
g_return_val_if_fail (!G_STR_EMPTY (token), FALSE);
g_return_val_if_fail (!EMP_STR_EMPTY (token), FALSE);
/* Load the avatar from file if it exists */
filename = contact_get_avatar_filename (contact, token);
......
......@@ -95,7 +95,7 @@ idle_presence_changed_cb (MissionControl *mc,
g_free (priv->status);
priv->state = state;
priv->status = NULL;
if (!G_STR_EMPTY (status)) {
if (!EMP_STR_EMPTY (status)) {
priv->status = g_strdup (status);
}
......@@ -433,7 +433,7 @@ empathy_idle_init (EmpathyIdle *idle)
g_clear_error (&error);
}
priv->status = mission_control_get_presence_message_actual (priv->mc, &error);
if (error || G_STR_EMPTY (priv->status)) {
if (error || EMP_STR_EMPTY (priv->status)) {
g_free (priv->status);
priv->status = NULL;
......@@ -590,7 +590,7 @@ empathy_idle_set_presence (EmpathyIdle *idle,
if (tp_strdiff (priv->status, status)) {
g_free (priv->status);
priv->status = NULL;
if (!G_STR_EMPTY (status)) {
if (!EMP_STR_EMPTY (status)) {
priv->status = g_strdup (status);
}
g_object_notify (G_OBJECT (idle), "status");
......
......@@ -170,7 +170,7 @@ empathy_log_manager_add_message (EmpathyLogManager *manager,
body_str = empathy_message_get_body (message);
msg_type = empathy_message_get_tptype (message);
if (G_STR_EMPTY (body_str)) {
if (EMP_STR_EMPTY (body_str)) {
return;
}
......@@ -384,7 +384,7 @@ empathy_log_manager_get_messages_for_file (EmpathyLogManager *manager,
sender = empathy_contact_new_full (account, sender_id, sender_name);
empathy_contact_set_is_user (sender, is_user);
if (!G_STR_EMPTY (sender_avatar_token)) {
if (!EMP_STR_EMPTY (sender_avatar_token)) {
empathy_contact_load_avatar_cache (sender,
sender_avatar_token);
}
......@@ -489,7 +489,7 @@ empathy_log_manager_search_new (EmpathyLogManager *manager,
gchar *text_casefold;
g_return_val_if_fail (EMPATHY_IS_LOG_MANAGER (manager), NULL);
g_return_val_if_fail (!G_STR_EMPTY (text), NULL);
g_return_val_if_fail (!EMP_STR_EMPTY (text), NULL);
text_casefold = g_utf8_casefold (text, -1);
......
......@@ -388,20 +388,20 @@ tp_call_stream_engine_watch_name_owner_cb (TpDBusDaemon *daemon,
{
EmpathyTpCallPriv *priv = GET_PRIV (call);
/* G_STR_EMPTY(new_owner) means either stream-engine has not started yet or
/* EMP_STR_EMPTY(new_owner) means either stream-engine has not started yet or
* has crashed. We want to close the channel if stream-engine has crashed.
* */
DEBUG ("Watch SE: name='%s' SE running='%s' new_owner='%s'",
name, priv->stream_engine_running ? "yes" : "no",
new_owner ? new_owner : "none");
if (priv->stream_engine_running && G_STR_EMPTY (new_owner))
if (priv->stream_engine_running && EMP_STR_EMPTY (new_owner))
{
DEBUG ("Stream engine falled off the bus");
empathy_tp_call_close (call);
return;
}
priv->stream_engine_running = !G_STR_EMPTY (new_owner);
priv->stream_engine_running = !EMP_STR_EMPTY (new_owner);
}
static void
......
......@@ -130,7 +130,7 @@ tp_contact_factory_presences_table_foreach (const gchar *state_str,
message_str = g_value_get_string (message);
}
if (!G_STR_EMPTY (message_str)) {
if (!EMP_STR_EMPTY (message_str)) {
empathy_contact_set_presence_message (contact, message_str);
} else {
empathy_contact_set_presence_message (contact, NULL);
......@@ -384,7 +384,7 @@ tp_contact_factory_avatar_maybe_update (EmpathyTpContactFactory *tp_factory,
}
/* Check if we have an avatar */
if (G_STR_EMPTY (token)) {
if (EMP_STR_EMPTY (token)) {
empathy_contact_set_avatar (contact, NULL);
return TRUE;
}
......@@ -783,12 +783,12 @@ tp_contact_factory_ready (EmpathyTpContactFactory *tp_factory)
handle = empathy_contact_get_handle (contact);
id = empathy_contact_get_id (contact);
if (handle == 0) {
g_assert (!G_STR_EMPTY (id));
g_assert (!EMP_STR_EMPTY (id));
g_array_append_val (handle_needed, id);
handle_needed_contacts = g_list_prepend (handle_needed_contacts,
g_object_ref (contact));
}
if (G_STR_EMPTY (id)) {
if (EMP_STR_EMPTY (id)) {
g_array_append_val (id_needed, handle);
id_needed_contacts = g_list_prepend (id_needed_contacts,
g_object_ref (contact));
......
......@@ -38,7 +38,7 @@
#include "empathy-contact.h"
#define EMPATHY_GET_PRIV(obj,type) ((type##Priv*) ((type*)obj)->priv)
#define G_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
#define EMP_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
G_BEGIN_DECLS
......
......@@ -176,7 +176,7 @@ megaphone_applet_update_icon (MegaphoneApplet *applet)
avatar_token = panel_applet_gconf_get_string (PANEL_APPLET (applet),
"avatar_token",
NULL);
if (!G_STR_EMPTY (avatar_token)) {
if (!EMP_STR_EMPTY (avatar_token)) {
empathy_contact_load_avatar_cache (priv->contact, avatar_token);
avatar = empathy_contact_get_avatar (priv->contact);
}
......
......@@ -658,7 +658,7 @@ accounts_dialog_account_added_cb (EmpathyAccountManager *manager,
* parameter for CM that have it. */
current_name = mc_account_get_display_name (account);
mc_account_get_param_string (account, "account", &account_param);
if (!G_STR_EMPTY (account_param)) {
if (!EMP_STR_EMPTY (account_param)) {
McProfile *profile;
const gchar *profile_name;
gchar *new_name;
......
......@@ -1556,7 +1556,7 @@ empathy_chat_window_find_chat (McAccount *account,
GList *l;
g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
g_return_val_if_fail (!G_STR_EMPTY (id), NULL);
g_return_val_if_fail (!EMP_STR_EMPTY (id), NULL);
for (l = chat_windows; l; l = l->next) {
EmpathyChatWindowPriv *priv;
......
......@@ -541,7 +541,7 @@ event_manager_pendings_changed_cb (EmpathyContactList *list,
g_string_printf (str, _("Subscription requested by %s"),
empathy_contact_get_name (contact));
if (!G_STR_EMPTY (message))
if (!EMP_STR_EMPTY (message))
g_string_append_printf (str, _("\nMessage: %s"), message);
event_manager_add (manager, contact, GTK_STOCK_DIALOG_QUESTION, str->str,
......
......@@ -332,7 +332,7 @@ new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
}
room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
gtk_widget_set_sensitive (dialog->button_join, !G_STR_EMPTY (room));
gtk_widget_set_sensitive (dialog->button_join, !EMP_STR_EMPTY (room));
/* Final set up of the dialog */
gtk_widget_grab_focus (dialog->entry_room);
......@@ -500,7 +500,7 @@ new_chatroom_dialog_join (EmpathyNewChatroomDialog *dialog)
account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
account = empathy_account_chooser_get_account (account_chooser);
if (!G_STR_EMPTY (server)) {
if (!EMP_STR_EMPTY (server)) {
room_name = g_strconcat (room, "@", server, NULL);
} else {
room_name = g_strdup (room);
......@@ -520,7 +520,7 @@ new_chatroom_dialog_entry_changed_cb (GtkWidget *entry,
const gchar *room;
room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
gtk_widget_set_sensitive (dialog->button_join, !G_STR_EMPTY (room));
gtk_widget_set_sensitive (dialog->button_join, !EMP_STR_EMPTY (room));
/* FIXME: Select the room in the list */
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment