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);
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
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",
&start, &end, FALSE);
}
- if (G_STR_EMPTY (str)) {
+ if (EMP_STR_EMPTY (str)) {
g_free (str);
return;
}
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));
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);
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);
&iter_start,
&iter_end);
- if (G_STR_EMPTY (text)) {
+ if (EMP_STR_EMPTY (text)) {
return;
}
priv = GET_PRIV (chat);
- if (G_STR_EMPTY (msg)) {
+ if (EMP_STR_EMPTY (msg)) {
return;
}
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);
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"));
/* 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);
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,
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;
}
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;
}
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,
GtkTreeModel *model;
FindName data;
- if (G_STR_EMPTY (name))
+ if (EMP_STR_EMPTY (name))
return FALSE;
data.information = information;
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
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);
gtk_list_store_clear (store);
- if (G_STR_EMPTY (search_criteria)) {
+ if (EMP_STR_EMPTY (search_criteria)) {
/* Just clear the search. */
return;
}
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);
}
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);
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) {
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);
{
gint i;
- if (G_STR_EMPTY (name)) {
+ if (EMP_STR_EMPTY (name)) {
return FALSE;
}
priv = GET_PRIV (chatroom);
- if (G_STR_EMPTY (priv->name)) {
+ if (EMP_STR_EMPTY (priv->name)) {
return priv->room;
}
/* 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;
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);
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;
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);
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),
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);
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);
}
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;
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");
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;
}
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);
}
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);
{
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
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);
}
/* Check if we have an avatar */
- if (G_STR_EMPTY (token)) {
+ if (EMP_STR_EMPTY (token)) {
empathy_contact_set_avatar (contact, NULL);
return TRUE;
}
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));
#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
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);
}
* 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;
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;
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,
}
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);
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);
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 */
}
}