Commit 539fe1b2 authored by Tristan Matthews's avatar Tristan Matthews

* #19683: gnome: use glib logging

parent 38bb6de5
......@@ -17,7 +17,6 @@ endif
noinst_LTLIBRARIES = libsflphone_client.la
libsflphone_client_la_SOURCES = \
logger.c \
uimanager.c \
sflnotify.c \
mainwindow.c \
......@@ -45,7 +44,6 @@ libsflphone_client_la_SOURCES = \
callable_obj.h \
conference_obj.h \
shortcuts.h \
logger.h \
str_utils.h \
seekslider.h \
account_schema.h \
......
......@@ -34,7 +34,6 @@
#include "dbus.h"
#include "accountlist.h"
#include "account_schema.h"
#include "logger.h"
#include "actions.h"
static GQueue * accountQueue;
......@@ -101,7 +100,7 @@ account_t *
account_list_get_by_id(const gchar * const accountID)
{
if (!accountID) {
DEBUG("AccountID is NULL");
g_debug("AccountID is NULL");
return NULL;
}
......@@ -242,7 +241,7 @@ void account_list_remove(const gchar *accountID)
if (target) {
#if GLIB_CHECK_VERSION(2, 30, 0)
if (!g_queue_remove(accountQueue, target))
ERROR("Could not remove account with ID %s", accountID);
g_error("Could not remove account with ID %s", accountID);
#else
g_queue_remove(accountQueue, target);
#endif
......
......@@ -57,7 +57,6 @@
#include "actions.h"
#include "dbus/dbus.h"
#include "logger.h"
#include "account_schema.h"
#include "contacts/calltab.h"
#include "contacts/searchbar.h"
......@@ -80,7 +79,7 @@ sflphone_notify_voice_mail(const gchar* accountID , guint count, SFLPhoneClient
gchar *id = g_strdup(accountID);
const gchar * const current_id = account_list_get_current_id();
DEBUG("sflphone_notify_voice_mail begin");
g_debug("sflphone_notify_voice_mail begin");
if (g_ascii_strcasecmp(id, current_id) != 0 ||
account_list_get_size() == 0)
......@@ -96,7 +95,7 @@ sflphone_notify_voice_mail(const gchar* accountID , guint count, SFLPhoneClient
if (current)
notify_voice_mails(count, current, client);
DEBUG("sflphone_notify_voice_mail end");
g_debug("sflphone_notify_voice_mail end");
}
/*
......@@ -200,7 +199,7 @@ void sflphone_fill_account_list(void)
for (gchar **accountID = array; accountID && *accountID; ++accountID) {
account_t *acc = create_account_with_ID(*accountID);
if (acc->properties == NULL) {
ERROR("SFLphone: Error: Could not fetch details for account %s",
g_error("SFLphone: Error: Could not fetch details for account %s",
accountID);
break;
}
......@@ -215,17 +214,17 @@ void sflphone_fill_account_list(void)
acc->state = ACCOUNT_STATE_UNREGISTERED;
else if (g_strcmp0(status, "TRYING") == 0)
acc->state = ACCOUNT_STATE_TRYING;
else if (g_strcmp0(status, "ERROR") == 0)
else if (g_strcmp0(status, "g_error") == 0)
acc->state = ACCOUNT_STATE_ERROR;
else if (g_strcmp0(status, "ERROR_AUTH") == 0)
else if (g_strcmp0(status, "g_error_AUTH") == 0)
acc->state = ACCOUNT_STATE_ERROR_AUTH;
else if (g_strcmp0(status, "ERROR_NETWORK") == 0)
else if (g_strcmp0(status, "g_error_NETWORK") == 0)
acc->state = ACCOUNT_STATE_ERROR_NETWORK;
else if (g_strcmp0(status, "ERROR_HOST") == 0)
else if (g_strcmp0(status, "g_error_HOST") == 0)
acc->state = ACCOUNT_STATE_ERROR_HOST;
else if (g_strcmp0(status, "ERROR_NOT_ACCEPTABLE") == 0)
else if (g_strcmp0(status, "g_error_NOT_ACCEPTABLE") == 0)
acc->state = ACCOUNT_STATE_ERROR_NOT_ACCEPTABLE;
else if (g_strcmp0(status, "ERROR_EXIST_STUN") == 0)
else if (g_strcmp0(status, "g_error_EXIST_STUN") == 0)
acc->state = ACCOUNT_STATE_ERROR_EXIST_STUN;
else if (g_strcmp0(status, "ACCOUNT_STATE_IP2IP_READY") == 0)
acc->state = ACCOUNT_STATE_IP2IP_READY;
......@@ -318,7 +317,7 @@ sflphone_hang_up(SFLPhoneClient *client)
dbus_refuse(selectedCall);
call_remove_all_errors(selectedCall);
selectedCall->_state = CALL_STATE_DIALING;
DEBUG("from sflphone_hang_up : ");
g_debug("from sflphone_hang_up : ");
break;
case CALL_STATE_TRANSFER:
dbus_hang_up(selectedCall);
......@@ -326,7 +325,7 @@ sflphone_hang_up(SFLPhoneClient *client)
time(&selectedCall->_time_stop);
break;
default:
WARN("Should not happen in sflphone_hang_up()!");
g_warning("Should not happen in sflphone_hang_up()!");
break;
}
}
......@@ -379,7 +378,7 @@ sflphone_pick_up(SFLPhoneClient *client)
sflphone_new_call(client);
break;
default:
WARN("Should not happen in sflphone_pick_up()!");
g_warning("Should not happen in sflphone_pick_up()!");
break;
}
}
......@@ -396,7 +395,7 @@ sflphone_on_hold()
dbus_hold(selectedCall);
break;
default:
WARN("Should not happen in sflphone_on_hold!");
g_warning("Should not happen in sflphone_on_hold!");
break;
}
} else if (selectedConf)
......@@ -406,7 +405,7 @@ sflphone_on_hold()
void
sflphone_off_hold()
{
DEBUG("%s", __PRETTY_FUNCTION__);
g_debug("%s", __PRETTY_FUNCTION__);
callable_obj_t * selectedCall = calltab_get_selected_call(current_calls_tab);
conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree_tab);
......@@ -416,7 +415,7 @@ sflphone_off_hold()
dbus_unhold(selectedCall);
break;
default:
WARN("Should not happen in sflphone_off_hold ()!");
g_warning("Should not happen in sflphone_off_hold ()!");
break;
}
} else if (selectedConf)
......@@ -503,7 +502,7 @@ sflphone_incoming_call(callable_obj_t * c, SFLPhoneClient *client)
}
account_t *account = account_list_get_by_id(c->_accountID);
if (!account) {
ERROR("Account is NULL");
g_error("Account is NULL");
} else if (account_has_autoanswer_on(account)) {
calltab_set_selected_call(active_calltree_tab, c);
sflphone_pick_up(client);
......@@ -721,28 +720,28 @@ sflphone_place_call(callable_obj_t * c, SFLPhoneClient *client)
account_t * account = NULL;
if (c == NULL) {
ERROR("Callable object is NULL while making new call");
g_error("Callable object is NULL while making new call");
return -1;
}
DEBUG("Placing call from %s to %s using account %s", c->_display_name, c->_peer_number, c->_accountID);
g_debug("Placing call from %s to %s using account %s", c->_display_name, c->_peer_number, c->_accountID);
if (c->_state != CALL_STATE_DIALING) {
ERROR("Call not in state dialing, cannot place call");
g_error("Call not in state dialing, cannot place call");
return -1;
}
if (!c->_peer_number || strlen(c->_peer_number) == 0) {
ERROR("No peer number set for this call");
g_error("No peer number set for this call");
return -1;
}
// Get the account for this call
if (strlen(c->_accountID) != 0) {
DEBUG("Account %s already set for this call", c->_accountID);
g_debug("Account %s already set for this call", c->_accountID);
account = account_list_get_by_id(c->_accountID);
} else {
DEBUG("No account set for this call, use first of the list");
g_debug("No account set for this call, use first of the list");
account = account_list_get_current();
}
......@@ -757,10 +756,10 @@ sflphone_place_call(callable_obj_t * c, SFLPhoneClient *client)
// If there is no account specified or found, fallback on IP2IP call
if(account == NULL) {
DEBUG("Could not find an account for this call, making ip to ip call");
g_debug("Could not find an account for this call, making ip to ip call");
account = account_list_get_by_id("IP2IP");
if (account == NULL) {
ERROR("Actions: Could not determine any account for this call");
g_error("Actions: Could not determine any account for this call");
return -1;
}
}
......@@ -786,7 +785,7 @@ sflphone_detach_participant(const gchar* callID)
else
selectedCall = calllist_get_call(current_calls_tab, callID);
DEBUG("Detach participant %s", selectedCall->_callID);
g_debug("Detach participant %s", selectedCall->_callID);
/*TODO elepage(2012) correct IM conversation*/
calltree_remove_call(current_calls_tab, selectedCall->_callID);
......@@ -797,12 +796,12 @@ sflphone_detach_participant(const gchar* callID)
void
sflphone_add_participant(const gchar* callID, const gchar* confID)
{
DEBUG("Add participant %s to conference %s", callID, confID);
g_debug("Add participant %s to conference %s", callID, confID);
callable_obj_t *call = calllist_get_call(current_calls_tab, callID);
if (call == NULL) {
ERROR("Could not find call");
g_error("Could not find call");
return;
}
......@@ -812,7 +811,7 @@ sflphone_add_participant(const gchar* callID, const gchar* confID)
void
sflphone_add_main_participant(const conference_obj_t * c)
{
DEBUG("%s", __PRETTY_FUNCTION__);
g_debug("%s", __PRETTY_FUNCTION__);
dbus_add_main_participant(c->_confID);
}
......@@ -823,11 +822,11 @@ sflphone_rec_call(SFLPhoneClient *client)
conference_obj_t * selectedConf = calltab_get_selected_conf(current_calls_tab);
if (selectedCall) {
DEBUG("Set record for selected call");
g_debug("Set record for selected call");
dbus_set_record(selectedCall->_callID);
calltree_update_call(current_calls_tab, selectedCall, client);
} else if (selectedConf) {
DEBUG("Set record for selected conf");
g_debug("Set record for selected conf");
dbus_set_record(selectedConf->_confID);
switch (selectedConf->_state) {
......@@ -844,11 +843,11 @@ sflphone_rec_call(SFLPhoneClient *client)
selectedConf->_state = CONFERENCE_STATE_ACTIVE_DETACHED_RECORD;
break;
default:
WARN("Should not happen in sflphone_off_hold ()!");
g_warning("Should not happen in sflphone_off_hold ()!");
break;
}
DEBUG("Remove and add conference %s", selectedConf->_confID);
g_debug("Remove and add conference %s", selectedConf->_confID);
calltree_remove_conference(current_calls_tab, selectedConf, client);
/* This calls update actions */
calltree_add_conference_to_current_calls(selectedConf, client);
......@@ -860,7 +859,7 @@ sflphone_rec_call(SFLPhoneClient *client)
void
sflphone_mute_call()
{
DEBUG("%s", __PRETTY_FUNCTION__);
g_debug("%s", __PRETTY_FUNCTION__);
toggle_slider_mute_microphone();
}
......@@ -885,7 +884,7 @@ sflphone_fill_audio_codec_list_per_account(account_t *account)
c->is_active = TRUE;
g_queue_push_tail(account->acodecs, c);
} else
ERROR("Couldn't find codec %d %p", payload, orig);
g_error("Couldn't find codec %d %p", payload, orig);
}
g_array_unref(order);
......@@ -1003,10 +1002,10 @@ sflphone_request_go_clear(void)
void
sflphone_call_state_changed(callable_obj_t * c, const gchar * description, const guint code, SFLPhoneClient *client)
{
DEBUG("Call State changed %s", description);
g_debug("Call State changed %s", description);
if (c == NULL) {
ERROR("SFLphone: Error: callable obj is NULL in %s at %d", __FILE__, __LINE__);
g_error("SFLphone: Error: callable obj is NULL in %s at %d", __FILE__, __LINE__);
return;
}
......
......@@ -40,7 +40,6 @@
#include <glib/gi18n.h>
#include "contacts/calltab.h"
#include "contacts/calltree.h"
#include "logger.h"
#include "dbus.h"
#include <unistd.h>
......@@ -319,11 +318,11 @@ gboolean call_was_outgoing(callable_obj_t * obj)
void restore_call(const gchar *id)
{
DEBUG("Restoring call %s", id);
g_debug("Restoring call %s", id);
// We fetch the details associated to the specified call
GHashTable *call_details = dbus_get_call_details(id);
if (!call_details) {
ERROR("Invalid call ID");
g_error("Invalid call ID");
return;
}
callable_obj_t *new_call = create_new_call_from_details(id, call_details);
......
......@@ -33,7 +33,6 @@
#endif
#include "codeclist.h"
#include "logger.h"
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
......
......@@ -34,7 +34,6 @@
#include "str_utils.h"
#include "dbus.h"
#include "sflphone_const.h"
#include "logger.h"
#include "calltab.h"
#include "calllist.h"
......@@ -42,11 +41,11 @@ conference_obj_t *
create_new_conference(conference_state_t state, const gchar* const confID)
{
if (confID == NULL) {
ERROR("Conference ID is NULL while creating new conference");
g_error("Conference ID is NULL while creating new conference");
return NULL;
}
DEBUG("Create new conference %s", confID);
g_debug("Create new conference %s", confID);
// Allocate memory
conference_obj_t *new_conf = g_new0(conference_obj_t, 1);
......@@ -110,7 +109,7 @@ void conference_add_participant_number(const gchar *call_id, conference_obj_t *c
callable_obj_t *call = calllist_get_call(current_calls_tab, call_id);
if (!call) {
ERROR("Could not find %s", call_id);
g_error("Could not find %s", call_id);
return;
}
......@@ -120,7 +119,7 @@ void conference_add_participant_number(const gchar *call_id, conference_obj_t *c
void conference_add_participant(const gchar* call_id, conference_obj_t* conf)
{
DEBUG("Conference %s, adding participant %s", conf->_confID, call_id);
g_debug("Conference %s, adding participant %s", conf->_confID, call_id);
// store the new participant list after appending participant id
conf->participant_list = g_slist_append(conf->participant_list, (gpointer) g_strdup(call_id));
......@@ -139,7 +138,7 @@ void conference_remove_participant(const gchar* call_id, conference_obj_t* conf)
void conference_participant_list_update(gchar** participants, conference_obj_t* conf)
{
if (!conf) {
ERROR("Conference is NULL");
g_error("Conference is NULL");
return;
}
......
......@@ -45,7 +45,6 @@
#include "config.h"
#include "str_utils.h"
#include "logger.h"
#include "actions.h"
#include "accountlist.h"
#include "audioconf.h"
......@@ -164,9 +163,9 @@ void
select_dtmf_type(void)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(overrtp)))
DEBUG("Selected DTMF over RTP");
g_debug("Selected DTMF over RTP");
else
DEBUG("Selected DTMF over SIP");
g_debug("Selected DTMF over SIP");
}
static GPtrArray* get_new_credential(void)
......@@ -188,7 +187,7 @@ static GPtrArray* get_new_credential(void)
COLUMN_CREDENTIAL_PASSWORD, &password,
-1);
DEBUG("Row %d: %s %s %s", row_count++, username, password, realm);
g_debug("Row %d: %s %s %s", row_count++, username, password, realm);
GHashTable * new_table = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, g_free);
......@@ -245,7 +244,7 @@ create_basic_tab(account_t *account)
else if (account_is_IAX(account))
table = gtk_table_new(8, 2, FALSE);
else {
ERROR("Unknown account type");
g_error("Unknown account type");
return NULL;
}
......@@ -283,7 +282,7 @@ create_basic_tab(account_t *account)
else if (account_is_IAX(account))
gtk_combo_box_set_active(GTK_COMBO_BOX(protocol_combo), 1);
else {
ERROR("Account protocol not valid");
g_error("Account protocol not valid");
/* Should never come here, add debug message. */
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(protocol_combo), _("Unknown"));
gtk_combo_box_set_active(GTK_COMBO_BOX(protocol_combo), 2);
......@@ -460,7 +459,7 @@ cell_edited_cb(GtkCellRendererText *renderer, gchar *path_desc, gchar *text,
GtkTreePath *path = gtk_tree_path_new_from_string(path_desc);
gint column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(renderer), "column"));
DEBUG("path desc: %s\n", text);
g_debug("path desc: %s\n", text);
if ((utf8_case_equal(path_desc, "0")) &&
!utf8_case_equal(text, gtk_entry_get_text(GTK_ENTRY(entry_username))))
......@@ -478,7 +477,7 @@ static void
editing_started_cb(G_GNUC_UNUSED GtkCellRenderer *cell, GtkCellEditable * editable,
const gchar * path, G_GNUC_UNUSED gpointer data)
{
DEBUG("path desc: %s\n", path);
g_debug("path desc: %s\n", path);
// If we are dealing the first row
if (utf8_case_equal(path, "0"))
......@@ -508,7 +507,7 @@ static void
key_exchange_changed_cb(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED gpointer data)
{
gchar *active_text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(key_exchange_combo));
DEBUG("Key exchange changed %s", active_text);
g_debug("Key exchange changed %s", active_text);
gboolean sensitive = FALSE;
sensitive |= utf8_case_equal(active_text, "SDES");
......@@ -520,7 +519,7 @@ key_exchange_changed_cb(G_GNUC_UNUSED GtkWidget *widget, G_GNUC_UNUSED gpointer
static void use_sip_tls_cb(GtkWidget *widget, gpointer data)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
DEBUG("Using sips");
g_debug("Using sips");
gtk_widget_set_sensitive(data, TRUE);
// Uncheck stun
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_stun_check_box), FALSE);
......@@ -566,7 +565,7 @@ get_interface_addr_from_name(const gchar * const iface_name)
int fd;
if ((fd = socket(AF_INET, SOCK_DGRAM,0)) < 0)
DEBUG("getInterfaceAddrFromName error could not open socket\n");
g_debug("getInterfaceAddrFromName error could not open socket\n");
struct ifreq ifr;
memset(&ifr, 0, sizeof(struct ifreq));
......@@ -575,7 +574,7 @@ get_interface_addr_from_name(const gchar * const iface_name)
ifr.ifr_addr.sa_family = AF_INET;
if (ioctl(fd, SIOCGIFADDR, &ifr) < 0)
DEBUG("getInterfaceAddrFromName use default interface (0.0.0.0)\n");
g_debug("getInterfaceAddrFromName use default interface (0.0.0.0)\n");
struct sockaddr_in *saddr_in = (struct sockaddr_in *) &ifr.ifr_addr;
......@@ -596,7 +595,7 @@ static void local_interface_changed_cb(G_GNUC_UNUSED GtkWidget * widget, G_GNUC_
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button))) {
gchar *local_iface_name = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(local_address_combo));
if (!local_iface_name) {
ERROR("Could not get local interface name");
g_error("Could not get local interface name");
return;
}
gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name);
......@@ -611,13 +610,13 @@ static void local_interface_changed_cb(G_GNUC_UNUSED GtkWidget * widget, G_GNUC_
static void set_published_addr_manually_cb(GtkWidget * widget, G_GNUC_UNUSED gpointer data)
{
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
DEBUG("Showing manual publishing options");
g_debug("Showing manual publishing options");
gtk_widget_show(published_port_label);
gtk_widget_show(published_port_spin_box);
gtk_widget_show(published_address_label);
gtk_widget_show(published_address_entry);
} else {
DEBUG("Hiding manual publishing options");
g_debug("Hiding manual publishing options");
gtk_widget_hide(published_port_label);
gtk_widget_hide(published_port_spin_box);
gtk_widget_hide(published_address_label);
......@@ -632,7 +631,7 @@ static void use_stun_cb(GtkWidget *widget, G_GNUC_UNUSED gpointer data)
return;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
DEBUG("Showing stun options, hiding Local/Published info");
g_debug("Showing stun options, hiding Local/Published info");
gtk_widget_show(stun_server_label);
gtk_widget_show(stun_server_entry);
gtk_widget_set_sensitive(stun_server_entry, TRUE);
......@@ -644,7 +643,7 @@ static void use_stun_cb(GtkWidget *widget, G_GNUC_UNUSED gpointer data)
gtk_widget_hide(published_address_entry);
gtk_widget_hide(published_port_spin_box);
} else {
DEBUG("disabling stun options, showing Local/Published info");
g_debug("disabling stun options, showing Local/Published info");
gtk_widget_set_sensitive(stun_server_entry, FALSE);
gtk_widget_set_sensitive(same_as_local_radio_button, TRUE);
gtk_widget_set_sensitive(published_addr_radio_button, TRUE);
......@@ -862,7 +861,7 @@ static GtkWidget* create_registration_expire(const account_t *account)
if (account && account->properties)
if (!g_hash_table_lookup_extended(account->properties, CONFIG_ACCOUNT_REGISTRATION_EXPIRE,
&orig_key, (gpointer) &account_expire))
ERROR("Could not retrieve %s from account properties",
g_error("Could not retrieve %s from account properties",
CONFIG_ACCOUNT_REGISTRATION_EXPIRE);
GtkWidget *table, *frame;
......@@ -925,7 +924,7 @@ create_network(const account_t *account)
local_address_entry = gtk_entry_new();
gchar *local_iface_name = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(local_address_combo));
if (!local_iface_name) {
ERROR("Could not get local interface name");
g_error("Could not get local interface name");
return frame;
}
gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name);
......@@ -1041,7 +1040,7 @@ GtkWidget* create_published_address(const account_t *account)
GtkWidget* create_advanced_tab(const account_t *account)
{
// Build the advanced tab, to appear on the account configuration panel
DEBUG("Build advanced tab");
g_debug("Build advanced tab");
GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
......@@ -1249,10 +1248,10 @@ static void update_account_from_basic_tab(account_t *account)
}
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(overrtp))) {
DEBUG("Set dtmf over rtp");
g_debug("Set dtmf over rtp");
account_replace(account, CONFIG_ACCOUNT_DTMF_TYPE, OVERRTP);
} else {
DEBUG("Set dtmf over sip");
g_debug("Set dtmf over sip");
account_replace(account, CONFIG_ACCOUNT_DTMF_TYPE, SIPINFO);
}
......
......@@ -38,7 +38,6 @@
#include "actions.h"
#include "mainwindow.h"
#include "utils.h"
#include "logger.h"
#include <glib/gi18n.h>
#include <string.h>
......@@ -105,7 +104,7 @@ find_account_in_account_store(const gchar *accountID, GtkTreeModel *model,
static void delete_account_cb(G_GNUC_UNUSED GtkButton *button, gpointer data)
{
gchar *selected_accountID = get_selected_accountID(data);
RETURN_IF_NULL(selected_accountID, "No selected account in delete action");
g_return_if_fail(selected_accountID != NULL);
GtkTreeModel *model = GTK_TREE_MODEL(account_store);
GtkTreeIter iter;
if (find_account_in_account_store(selected_accountID, model, &iter))
......@@ -129,7 +128,7 @@ static void row_activated_cb(GtkTreeView *view,
SFLPhoneClient *client)
{
gchar *selected_accountID = get_selected_accountID(view);
RETURN_IF_NULL(selected_accountID, "No selected account ID");
g_return_if_fail(selected_accountID != NULL);
run_account_dialog(selected_accountID, client);
g_free(selected_accountID);
}
......@@ -142,7 +141,7 @@ typedef struct EditData {
static void edit_account_cb(G_GNUC_UNUSED GtkButton *button, EditData *data)
{
gchar *selected_accountID = get_selected_accountID(GTK_TREE_VIEW(data->view));
RETURN_IF_NULL(selected_accountID, "No selected account ID");
g_return_if_fail(selected_accountID != NULL);
run_account_dialog(selected_accountID, data->client);
g_free(selected_accountID);
}
......@@ -151,7 +150,7 @@ static void account_store_add(GtkTreeIter *iter, account_t *account)
{
const gchar *enabled = account_lookup(account, CONFIG_ACCOUNT_ENABLE);
const gchar *type = account_lookup(account, CONFIG_ACCOUNT_TYPE);
DEBUG("Account is enabled :%s", enabled);
g_debug("Account is enabled :%s", enabled);
const gchar *state_name = account_state_name(account->state);
gtk_list_store_set(account_store, iter,
......@@ -168,13 +167,13 @@ static void account_store_add(GtkTreeIter *iter, account_t *account)
*/
static void account_store_fill()
{
RETURN_IF_NULL(account_list_dialog, "No account dialog");
g_return_if_fail(account_list_dialog != NULL);
gtk_list_store_clear(account_store);
// IP2IP account must be first
account_t *ip2ip = account_list_get_by_id(IP2IP_PROFILE);
ip2ip->state = ACCOUNT_STATE_IP2IP_READY;
RETURN_IF_NULL(ip2ip, "Could not find IP2IP account");
g_return_if_fail(ip2ip != NULL);
GtkTreeIter iter;
gtk_list_store_append(account_store, &iter);
......@@ -183,7 +182,7 @@ static void account_store_fill()
for (size_t i = 0; i < account_list_get_size(); ++i) {
account_t *a = account_list_get_nth(i);
RETURN_IF_NULL(a, "Account %d is NULL", i);
g_return_if_fail(a != NULL);
// we don't want to process the IP2IP twice
if (a != ip2ip) {
......@@ -224,9 +223,9 @@ select_account_cb(GtkTreeSelection *selection, GtkTreeModel *model)
gchar *selected_accountID = g_value_dup_string(&val);