comparison src/gtkstatusselector.c @ 10183:9cff8cc12746

[gaim-migrate @ 11298] This bad boy was crashing when logging out because it was trying to free some static strings. I talked to the Chipmeister and he said it was ok to just remove the thing. So I did! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 15 Nov 2004 00:32:13 +0000
parents 97ee3bf7bcf7
children 5a1fe52036ad
comparison
equal deleted inserted replaced
10182:4085b2cda8f1 10183:9cff8cc12746
39 GtkWidget *sw; 39 GtkWidget *sw;
40 40
41 #if GTK_CHECK_VERSION(2,4,0) 41 #if GTK_CHECK_VERSION(2,4,0)
42 GtkListStore *model; 42 GtkListStore *model;
43 #endif 43 #endif
44
45 GHashTable *icon_table;
46 }; 44 };
47 45
48 #if GTK_CHECK_VERSION(2,4,0) 46 #if GTK_CHECK_VERSION(2,4,0)
49 enum 47 enum
50 { 48 {
118 GtkCellRenderer *renderer; 116 GtkCellRenderer *renderer;
119 #endif 117 #endif
120 118
121 selector->priv = g_new0(GaimGtkStatusSelectorPrivate, 1); 119 selector->priv = g_new0(GaimGtkStatusSelectorPrivate, 1);
122 120
123 selector->priv->icon_table =
124 g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
125
126 g_hash_table_insert(selector->priv->icon_table,
127 "online", "available.png");
128 g_hash_table_insert(selector->priv->icon_table,
129 "away", "away.png");
130
131 #if GTK_CHECK_VERSION(2,4,0) 121 #if GTK_CHECK_VERSION(2,4,0)
132 selector->priv->model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_POINTER, 122 selector->priv->model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_POINTER,
133 GDK_TYPE_PIXBUF, G_TYPE_STRING); 123 GDK_TYPE_PIXBUF, G_TYPE_STRING);
134 124
135 combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(selector->priv->model)); 125 combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(selector->priv->model));
211 201
212 g_return_if_fail(obj != NULL); 202 g_return_if_fail(obj != NULL);
213 g_return_if_fail(GAIM_GTK_IS_STATUS_SELECTOR(obj)); 203 g_return_if_fail(GAIM_GTK_IS_STATUS_SELECTOR(obj));
214 204
215 selector = GAIM_GTK_STATUS_SELECTOR(obj); 205 selector = GAIM_GTK_STATUS_SELECTOR(obj);
216
217 if (selector->priv->icon_table != NULL)
218 {
219 g_hash_table_destroy(selector->priv->icon_table);
220 selector->priv->icon_table = NULL;
221 }
222 206
223 if (GTK_OBJECT_CLASS(parent_class)->destroy) 207 if (GTK_OBJECT_CLASS(parent_class)->destroy)
224 GTK_OBJECT_CLASS(parent_class)->destroy(obj); 208 GTK_OBJECT_CLASS(parent_class)->destroy(obj);
225 } 209 }
226 210