#include <telepathy-glib/connection-manager.h>
#include <telepathy-glib/interfaces.h>
-#ifdef ENABLE_TPL
#include <telepathy-logger/log-manager.h>
-#include <telepathy-logger/log-store-empathy.h>
-#else
-#include <libempathy/empathy-log-manager.h>
-#endif /* ENABLE_TPL */
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-call-factory.h>
#include <libempathy/empathy-dispatcher.h>
#include <libempathy/empathy-dispatch-operation.h>
#include <libempathy/empathy-ft-factory.h>
+#include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-tp-chat.h>
#include <libempathy/empathy-tp-call.h>
-#include <libempathy-gtk/empathy-conf.h>
#include <libempathy-gtk/empathy-ui-utils.h>
#include <libempathy-gtk/empathy-location-manager.h>
}
static void
-use_conn_notify_cb (EmpathyConf *conf,
+use_conn_notify_cb (GSettings *gsettings,
const gchar *key,
gpointer user_data)
{
EmpathyConnectivity *connectivity = user_data;
- gboolean use_conn;
- if (empathy_conf_get_bool (conf, key, &use_conn))
- {
- empathy_connectivity_set_use_conn (connectivity, use_conn);
- }
+ empathy_connectivity_set_use_conn (connectivity,
+ g_settings_get_boolean (gsettings, key));
}
static void
GError *error = NULL;
EmpathyIdle *idle;
EmpathyConnectivity *connectivity;
- gboolean autoconnect = TRUE;
TpConnectionPresenceType presence;
+ GSettings *gsettings = g_settings_new (EMPATHY_PREFS_SCHEMA);
if (!tp_account_manager_prepare_finish (manager, result, &error))
{
presence = tp_account_manager_get_most_available_presence (manager, NULL,
NULL);
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_AUTOCONNECT, &autoconnect);
- if (autoconnect && !no_connect &&
+ if (g_settings_get_boolean (gsettings, EMPATHY_PREFS_AUTOCONNECT) &&
+ !no_connect &&
tp_connection_presence_type_cmp_availability
(presence, TP_CONNECTION_PRESENCE_TYPE_OFFLINE)
<= 0)
g_object_unref (idle);
g_object_unref (connectivity);
+ g_object_unref (gsettings);
}
static EmpathyDispatcher *
}
static void
-empathy_idle_set_auto_away_cb (EmpathyConf *conf,
+empathy_idle_set_auto_away_cb (GSettings *gsettings,
const gchar *key,
gpointer user_data)
{
- gboolean autoaway;
EmpathyIdle *idle = user_data;
- empathy_conf_get_bool (conf, key, &autoaway);
- empathy_idle_set_auto_away (idle, autoaway);
+ empathy_idle_set_auto_away (idle,
+ g_settings_get_boolean (gsettings, key));
}
int
EmpathyStatusIcon *icon;
EmpathyDispatcher *dispatcher;
TpAccountManager *account_manager;
-#ifdef ENABLE_TPL
TplLogManager *log_manager;
-#else
- EmpathyLogManager *log_manager;
-#endif /* ENABLE_TPL */
EmpathyChatroomManager *chatroom_manager;
EmpathyCallFactory *call_factory;
EmpathyFTFactory *ft_factory;
#ifdef ENABLE_DEBUG
TpDebugSender *debug_sender;
#endif
+ GSettings *gsettings;
GOptionContext *optcontext;
GOptionEntry options[] = {
/* Setting up Idle */
idle = empathy_idle_dup_singleton ();
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_AUTOAWAY, &autoaway);
+ gsettings = g_settings_new (EMPATHY_PREFS_SCHEMA);
+ autoaway = g_settings_get_boolean (gsettings, EMPATHY_PREFS_AUTOAWAY);
- empathy_conf_notify_add (empathy_conf_get (),
- EMPATHY_PREFS_AUTOAWAY,
- empathy_idle_set_auto_away_cb,
- idle);
+ g_signal_connect (gsettings,
+ "changed::" EMPATHY_PREFS_AUTOAWAY,
+ G_CALLBACK (empathy_idle_set_auto_away_cb), idle);
empathy_idle_set_auto_away (idle, autoaway);
/* Setting up Connectivity */
connectivity = empathy_connectivity_dup_singleton ();
- use_conn_notify_cb (empathy_conf_get (), EMPATHY_PREFS_USE_CONN,
+ use_conn_notify_cb (gsettings, EMPATHY_PREFS_USE_CONN,
connectivity);
- empathy_conf_notify_add (empathy_conf_get (), EMPATHY_PREFS_USE_CONN,
- use_conn_notify_cb, connectivity);
+ g_signal_connect (gsettings,
+ "changed::" EMPATHY_PREFS_USE_CONN,
+ G_CALLBACK (use_conn_notify_cb), connectivity);
/* account management */
account_manager = tp_account_manager_dup ();
G_CALLBACK (unique_app_message_cb), window);
/* Logging */
-#ifdef ENABLE_TPL
log_manager = tpl_log_manager_dup_singleton ();
-#else
- log_manager = empathy_log_manager_dup_singleton ();
- empathy_log_manager_observe (log_manager, dispatcher);
-#endif
chatroom_manager = empathy_chatroom_manager_dup_singleton (NULL);
empathy_chatroom_manager_observe (chatroom_manager, dispatcher);
#endif
g_object_unref (ft_factory);
g_object_unref (unique_app);
+ g_object_unref (gsettings);
notify_uninit ();
xmlCleanupParser ();