diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-26 21:40:16 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-30 19:35:23 +0800 |
commit | 00d66d902bbec612e612275191f917ac9f56b028 (patch) | |
tree | 5f053b97b0d13a1ddd2fa8117104d20866347461 /src | |
parent | 6101ab6b84beb8a9e19527a2416e0e6fcd6438c1 (diff) | |
download | gsoc2013-empathy-00d66d902bbec612e612275191f917ac9f56b028.tar gsoc2013-empathy-00d66d902bbec612e612275191f917ac9f56b028.tar.gz gsoc2013-empathy-00d66d902bbec612e612275191f917ac9f56b028.tar.bz2 gsoc2013-empathy-00d66d902bbec612e612275191f917ac9f56b028.tar.lz gsoc2013-empathy-00d66d902bbec612e612275191f917ac9f56b028.tar.xz gsoc2013-empathy-00d66d902bbec612e612275191f917ac9f56b028.tar.zst gsoc2013-empathy-00d66d902bbec612e612275191f917ac9f56b028.zip |
map-view: add a mapping from EmpathyContact to ChamplainMarker
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-map-view.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index 287d9b6ff..17e3897a6 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -56,6 +56,8 @@ typedef struct { ChamplainView *map_view; ChamplainLayer *layer; guint timeout_id; + /* reffed (EmpathyContact *) => borrowed (ChamplainMarker *) */ + GHashTable *markers; } EmpathyMapView; static void @@ -264,6 +266,8 @@ map_view_contacts_foreach (GtkTreeModel *model, g_object_set_data_full (G_OBJECT (marker), "contact", g_object_ref (contact), g_object_unref); + g_hash_table_insert (window->markers, g_object_ref (contact), marker); + map_view_contacts_update_label (CHAMPLAIN_MARKER (marker)); clutter_actor_set_reactive (CLUTTER_ACTOR (marker), TRUE); @@ -303,6 +307,7 @@ map_view_destroy_cb (GtkWidget *widget, item = g_list_next (item); } + g_hash_table_destroy (window->markers); g_object_unref (window->list_store); g_object_unref (window->layer); g_slice_free (EmpathyMapView, window); @@ -412,6 +417,9 @@ empathy_map_view_show (void) G_CALLBACK (map_view_state_changed), window); /* Set up contact list. */ + window->markers = g_hash_table_new_full (NULL, NULL, + (GDestroyNotify) g_object_unref, NULL); + model = GTK_TREE_MODEL (window->list_store); gtk_tree_model_foreach (model, map_view_contacts_foreach, window); |