Mercurial > pidgin
comparison plugins/chatlist.c @ 4164:a55c2a0ddcd4
[gaim-migrate @ 4393]
The chat list plugin wasn't working, due to a left-over variable that
is in a perpetual state of NULLness, and the checking of that variable
for a value before loading chats. Fixed.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 01 Jan 2003 03:03:25 +0000 |
parents | 22e3bbbd9a32 |
children | 07a3d1fae88f |
comparison
equal
deleted
inserted
replaced
4163:986c175a607c | 4164:a55c2a0ddcd4 |
---|---|
26 }; | 26 }; |
27 | 27 |
28 static GtkWidget *item = NULL; /* this is the parent tree */ | 28 static GtkWidget *item = NULL; /* this is the parent tree */ |
29 static GList *chat_rooms = NULL; | 29 static GList *chat_rooms = NULL; |
30 | 30 |
31 static GtkWidget *parent = NULL; /* this is the config thing where you can see the list */ | |
32 static struct chat_page *cp = NULL; | 31 static struct chat_page *cp = NULL; |
33 | 32 |
34 static void des_item() | 33 static void des_item() |
35 { | 34 { |
36 if (item) | 35 if (item) |
142 GList *items = GTK_LIST(cp->list1)->children; | 141 GList *items = GTK_LIST(cp->list1)->children; |
143 struct chat_room *cr; | 142 struct chat_room *cr; |
144 c = text; | 143 c = text; |
145 | 144 |
146 if (!text) | 145 if (!text) |
147 return; | |
148 if (!parent) | |
149 return; | 146 return; |
150 | 147 |
151 len = strlen(text); | 148 len = strlen(text); |
152 | 149 |
153 while (items) { | 150 while (items) { |
194 t++; | 191 t++; |
195 } | 192 } |
196 cr = g_new0(struct chat_room, 1); | 193 cr = g_new0(struct chat_room, 1); |
197 strcpy(cr->name, name); | 194 strcpy(cr->name, name); |
198 cr->exchange = exchange; | 195 cr->exchange = exchange; |
196 printf("Adding '%s'\n", name); | |
199 item = gtk_list_item_new_with_label(name); | 197 item = gtk_list_item_new_with_label(name); |
200 gtk_widget_show(item); | 198 gtk_widget_show(item); |
201 items = g_list_append(items, item); | 199 items = g_list_append(items, item); |
202 gtk_object_set_user_data(GTK_OBJECT(item), cr); | 200 gtk_object_set_user_data(GTK_OBJECT(item), cr); |
203 g_free(name); | 201 g_free(name); |
386 return NULL; | 384 return NULL; |
387 } | 385 } |
388 | 386 |
389 G_MODULE_EXPORT void gaim_plugin_remove() | 387 G_MODULE_EXPORT void gaim_plugin_remove() |
390 { | 388 { |
391 if (parent) | |
392 gtk_widget_destroy(parent); | |
393 parent = NULL; | |
394 | |
395 if (item) | 389 if (item) |
396 gtk_tree_remove_item(GTK_TREE(buddies), item); | 390 gtk_tree_remove_item(GTK_TREE(buddies), item); |
397 item = NULL; | 391 item = NULL; |
398 | 392 |
399 while (chat_rooms) { | 393 while (chat_rooms) { |