[Galago-commits] r2813 - in branches/libgalago/push-presence: .
libgalago
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Wed May 24 21:40:31 PDT 2006
Author: chipx86
Date: 2006-05-24 21:40:25 -0700 (Wed, 24 May 2006)
New Revision: 2813
Modified:
branches/libgalago/push-presence/ChangeLog
branches/libgalago/push-presence/libgalago/galago-status.c
Log:
Remove the existing attribute support from GalagoStatus.
Modified: branches/libgalago/push-presence/ChangeLog
===================================================================
--- branches/libgalago/push-presence/ChangeLog 2006-05-24 02:12:37 UTC (rev 2812)
+++ branches/libgalago/push-presence/ChangeLog 2006-05-25 04:40:25 UTC (rev 2813)
@@ -1,3 +1,8 @@
+Wed May 24 21:37:54 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * libgalago/galago-status.c:
+ - Remove the existing attribute support from GalagoStatus.
+
Mon May 22 01:26:17 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
* libgalago/galago-service.c:
Modified: branches/libgalago/push-presence/libgalago/galago-status.c
===================================================================
--- branches/libgalago/push-presence/libgalago/galago-status.c 2006-05-24 02:12:37 UTC (rev 2812)
+++ branches/libgalago/push-presence/libgalago/galago-status.c 2006-05-25 04:40:25 UTC (rev 2813)
@@ -36,9 +36,6 @@
char *name;
gboolean exclusive;
-
- GHashTable *attrs_table;
- GList *attrs;
};
enum
@@ -66,13 +63,6 @@
const GValue *value, GParamSpec *pspec);
static void galago_status_get_property(GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
-static void galago_status_set_attribute(GalagoObject *object,
- const char *name, GValue *value);
-static gboolean galago_status_remove_attribute(GalagoObject *object,
- const char *name);
-const GValue *galago_status_get_attribute(const GalagoObject *object,
- const char *name);
-GList *galago_status_get_attributes(const GalagoObject *object);
static GalagoObjectClass *parent_class = NULL;
@@ -86,16 +76,10 @@
parent_class = g_type_class_peek_parent(klass);
- object_class->supports_attrs = TRUE;
-
object_class->destroy = galago_status_destroy;
object_class->dbus_message_append = galago_status_dbus_message_append;
object_class->dbus_message_get = galago_status_dbus_message_get;
object_class->dbus_get_signature = galago_status_dbus_get_signature;
- object_class->set_attribute = galago_status_set_attribute;
- object_class->remove_attribute = galago_status_remove_attribute;
- object_class->get_attribute = galago_status_get_attribute;
- object_class->get_attributes = galago_status_get_attributes;
gobject_class->set_property = galago_status_set_property;
gobject_class->get_property = galago_status_get_property;
@@ -141,10 +125,6 @@
galago_status_init(GalagoStatus *status)
{
status->priv = g_new0(GalagoStatusPrivate, 1);
-
- status->priv->attrs_table =
- g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
- (GFreeFunc)galago_key_value_destroy);
}
static void
@@ -154,9 +134,6 @@
if (status->priv != NULL)
{
- g_hash_table_destroy(status->priv->attrs_table);
- g_list_free(status->priv->attrs);
-
if (status->priv->id != NULL)
g_free(status->priv->id);
@@ -176,8 +153,7 @@
const GalagoObject *object)
{
GalagoStatus *status = (GalagoStatus *)object;
- GList *l;
- DBusMessageIter array_iter, struct_iter, value_iter;
+ DBusMessageIter array_iter;
GalagoStatusType type;
const char *id, *name;
gboolean exclusive;
@@ -196,6 +172,7 @@
galago_status_attr_dbus_get_signature(),
&array_iter);
+#if 0
for (l = galago_object_get_attributes(GALAGO_OBJECT(status));
l != NULL;
l = l->next)
@@ -256,6 +233,7 @@
dbus_message_iter_close_container(&array_iter, &struct_iter);
}
+#endif
dbus_message_iter_close_container(iter, &array_iter);
}
@@ -537,7 +515,6 @@
galago_status_duplicate(const GalagoStatus *status)
{
GalagoStatus *new_status;
- GList *l;
g_return_val_if_fail(status != NULL, NULL);
g_return_val_if_fail(GALAGO_IS_STATUS(status), NULL);
@@ -547,6 +524,7 @@
galago_status_get_name(status),
galago_status_is_exclusive(status));
+#if 0
for (l = galago_object_get_attributes(GALAGO_OBJECT(status));
l != NULL;
l = l->next)
@@ -574,6 +552,7 @@
key_value->key, g_value_get_double(key_value->value));
}
}
+#endif
return new_status;
}
@@ -707,78 +686,3 @@
return type == GALAGO_STATUS_AVAILABLE ||
type == GALAGO_STATUS_HIDDEN;
}
-
-static void
-galago_status_set_attribute(GalagoObject *object, const char *name,
- GValue *value)
-{
- GalagoStatus *status = GALAGO_STATUS(object);
- GalagoPresence *presence;
- GalagoKeyValue *key_value;
-
- key_value = g_hash_table_lookup(status->priv->attrs_table, name);
-
- if (key_value == NULL)
- {
- key_value = galago_key_value_new(name, value);
-
- g_hash_table_insert(status->priv->attrs_table,
- g_strdup(name), key_value);
- status->priv->attrs = g_list_append(status->priv->attrs, key_value);
- }
- else if (G_VALUE_HOLDS(key_value->value, G_VALUE_TYPE(value)))
- {
- g_value_unset(key_value->value);
- g_free(key_value->value);
- key_value->value = value;
- }
- else
- {
- g_warning("Attempted to set existing attribute ID %s of type %s with "
- "attribute of type %s",
- name,
- G_VALUE_TYPE_NAME(key_value->value),
- G_VALUE_TYPE_NAME(value));
-
- return;
- }
-
- presence = galago_status_get_presence(status);
-
- if (presence != NULL)
- g_signal_emit_by_name(presence, "status-updated", 0, status, name);
-}
-
-static gboolean
-galago_status_remove_attribute(GalagoObject *object, const char *name)
-{
- GalagoStatus *status = GALAGO_STATUS(object);
- GalagoKeyValue *key_value;
-
- key_value = g_hash_table_lookup(status->priv->attrs_table, name);
-
- if (key_value == NULL)
- return FALSE;
-
- g_hash_table_remove(status->priv->attrs_table, name);
- status->priv->attrs = g_list_remove(status->priv->attrs, key_value);
-
- return TRUE;
-}
-
-const GValue *
-galago_status_get_attribute(const GalagoObject *object, const char *name)
-{
- GalagoStatus *status = GALAGO_STATUS(object);
- GalagoKeyValue *key_value;
-
- key_value = g_hash_table_lookup(status->priv->attrs_table, name);
-
- return (key_value == NULL ? NULL : key_value->value);
-}
-
-GList *
-galago_status_get_attributes(const GalagoObject *object)
-{
- return GALAGO_STATUS(object)->priv->attrs;
-}
More information about the galago-commits
mailing list