summaryrefslogtreecommitdiff
path: root/telepathy-logger/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'telepathy-logger/conf.c')
-rw-r--r--telepathy-logger/conf.c144
1 files changed, 0 insertions, 144 deletions
diff --git a/telepathy-logger/conf.c b/telepathy-logger/conf.c
index 86ccda4..1f094c5 100644
--- a/telepathy-logger/conf.c
+++ b/telepathy-logger/conf.c
@@ -22,7 +22,6 @@
#include "config.h"
#include "conf-internal.h"
-#include "tpl-marshal.h"
#include <glib.h>
#include <gio/gio.h>
@@ -36,77 +35,17 @@
#define GSETTINGS_SCHEMA "org.freedesktop.Telepathy.Logger"
#define KEY_ENABLED "enabled"
-#define KEY_IGNORE_ACCOUNTS "ignore-accounts"
G_DEFINE_TYPE (TplConf, _tpl_conf, G_TYPE_OBJECT)
static TplConf *conf_singleton = NULL;
-enum /* signals */
-{
- IGNORE_ACCOUNTS_CHANGED,
- LAST_SIGNAL
-};
-
-static guint _signals[LAST_SIGNAL] = { 0, };
-
typedef struct {
GSettings *gsettings;
-
- GHashTable *ignore_accounts; /* char * -> NULL */
} TplConfPriv;
static void
-_ignore_accounts_changed (GSettings *gsettings,
- gchar *key,
- TplConf *self)
-{
- TplConfPriv *priv = GET_PRIV (self);
- GVariant *v, *child;
- GVariantIter iter;
- GList *added = NULL, *removed;
- GHashTable *new_ignore_accounts, *old_ignore_accounts;
-
- new_ignore_accounts = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, NULL);
-
- /* walk the new ignore list, work out what's been added */
- v = g_settings_get_value (priv->gsettings, KEY_IGNORE_ACCOUNTS);
- g_variant_iter_init (&iter, v);
- while ((child = g_variant_iter_next_value (&iter)))
- {
- const gchar *o = g_variant_get_string (child, NULL);
-
- if (!g_hash_table_remove (priv->ignore_accounts, o))
- {
- /* account is not in list */
- added = g_list_prepend (added, (gpointer) o);
- }
-
- g_hash_table_insert (new_ignore_accounts, g_strdup (o),
- GUINT_TO_POINTER (TRUE));
-
- g_variant_unref (child);
- }
-
- /* get the remaining keys */
- removed = g_hash_table_get_keys (priv->ignore_accounts);
-
- /* swap priv->ignore_accounts over before emitting the signal */
- old_ignore_accounts = priv->ignore_accounts;
- priv->ignore_accounts = new_ignore_accounts;
-
- g_signal_emit (self, _signals[IGNORE_ACCOUNTS_CHANGED], 0, added, removed);
-
- g_variant_unref (v);
- g_list_free (added);
- g_list_free (removed);
- g_hash_table_destroy (old_ignore_accounts);
-}
-
-
-static void
tpl_conf_finalize (GObject *obj)
{
TplConfPriv *priv;
@@ -141,7 +80,6 @@ tpl_conf_constructor (GType type,
conf_singleton = TPL_CONF (retval);
g_object_add_weak_pointer (retval, (gpointer *) &conf_singleton);
}
-
return retval;
}
@@ -154,15 +92,6 @@ _tpl_conf_class_init (TplConfClass *klass)
object_class->finalize = tpl_conf_finalize;
object_class->constructor = tpl_conf_constructor;
- _signals[IGNORE_ACCOUNTS_CHANGED] = g_signal_new ("ignore-accounts-changed",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL, NULL,
- tpl_marshal_VOID__POINTER_POINTER,
- G_TYPE_NONE,
- 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
g_type_class_add_private (object_class, sizeof (TplConfPriv));
}
@@ -174,12 +103,6 @@ _tpl_conf_init (TplConf *self)
TPL_TYPE_CONF, TplConfPriv);
priv->gsettings = g_settings_new (GSETTINGS_SCHEMA);
-
- priv->ignore_accounts = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, NULL);
-
- g_signal_connect (priv->gsettings, "changed::" KEY_IGNORE_ACCOUNTS,
- G_CALLBACK (_ignore_accounts_changed), self);
}
@@ -239,70 +162,3 @@ _tpl_conf_globally_enable (TplConf *self,
g_settings_set_boolean (GET_PRIV (self)->gsettings,
KEY_ENABLED, enable);
}
-
-
-#if 0
-/**
- * _tpl_conf_get_accounts_ignorelist
- * @self: a TplConf instance
- *
- * The list of ignored accounts. If an account is ignored, no signals for this
- * account will be logged.
- *
- * Returns: a GList of (gchar *) contaning ignored accounts' object paths
- */
-GSList *
-_tpl_conf_get_accounts_ignorelist (TplConf *self)
-{
- GSList *ret = NULL;
- GVariant *v;
-
- g_return_val_if_fail (TPL_IS_CONF (self), NULL);
-
- v = g_settings_get_value (GET_PRIV (self)->gsettings, KEY_IGNORE_ACCOUNTS);
-
- return ret;
-}
-
-
-/**
- * _tpl_conf_set_accounts_ignorelist
- * @self: a TplConf instance
- * @newlist: a new GList containing account's object paths (gchar *) to be
- * ignored
- *
- * Globally disables logging for @newlist account's path. If an account is
- * disabled, no signals for such account will be logged.
- *
- * Note that this will change the global TPL configuration, affecting all the
- * TPL instances, including the TPL logging process and all the clients using
- * libtelepathy-logger.
- */
-void
-_tpl_conf_set_accounts_ignorelist (TplConf *self,
- GSList *newlist)
-{
- g_return_if_fail (TPL_IS_CONF (self));
-}
-#endif
-
-
-/**
- * _tpl_conf_is_account_ignored
- * @self: a TplConf instance
- * @account_path: a TpAccount object-path
- *
- * Whether @account_path is enabled or disabled (aka ignored).
- *
- * Returns: %TRUE if @account_path is ignored, %FALSE otherwise
- */
-gboolean
-_tpl_conf_is_account_ignored (TplConf *self,
- const gchar *account_path)
-{
- g_return_val_if_fail (TPL_IS_CONF (self), FALSE);
- g_return_val_if_fail (!TPL_STR_EMPTY (account_path), FALSE);
-
- return g_hash_table_lookup (GET_PRIV (self)->ignore_accounts, account_path)
- != NULL;
-}