gaim/gaim

sf patch #1185433, from Richard Laager

2005-04-18, Mark Doliner
714a0e9e6b95
Parents 41d13a60e382
Children 0ecd7e143b19
sf patch #1185433, from Richard Laager
"The gestures plugin started giving me compiler
warnings. I tracked them down and rewrote the appropriate
section of code. Tested and found to work."
--- a/plugins/gestures/gestures.c Mon Apr 18 23:18:50 2005 -0400
+++ b/plugins/gestures/gestures.c Mon Apr 18 23:29:40 2005 -0400
@@ -57,18 +57,28 @@
{
GaimConversation *conv;
GaimConvWindow *win;
- unsigned int index;
+ GList *conversations;
conv = (GaimConversation *)data;
win = gaim_conversation_get_window(conv);
- index = gaim_conversation_get_index(conv);
- if (index == 0)
- index = gaim_conv_window_get_conversation_count(win) - 1;
- else
- index--;
+ for (conversations = gaim_conv_window_get_conversations(win);
+ conversations != NULL;
+ conversations = conversations->next)
+ {
+ if (conversations->data == conv)
+ {
+ if (conversations->prev != NULL) {
+ gaim_conv_window_switch_conversation(win,
+ conversations->prev->data);
+ } else {
+ gaim_conv_window_switch_conversation(win,
+ g_list_last(conversations)->data);
+ }
- gaim_conv_window_switch_conversation(win, index);
+ return;
+ }
+ }
}
static void
@@ -76,18 +86,28 @@
{
GaimConversation *conv;
GaimConvWindow *win;
- unsigned int index;
+ GList *conversations;
conv = (GaimConversation *)data;
win = gaim_conversation_get_window(conv);
- index = gaim_conversation_get_index(conv);
- if (index == gaim_conv_window_get_conversation_count(win) - 1)
- index = 0;
- else
- index++;
+ for (conversations = gaim_conv_window_get_conversations(win);
+ conversations != NULL;
+ conversations = conversations->next)
+ {
+ if (conversations->data == conv)
+ {
+ if (conversations->next != NULL) {
+ gaim_conv_window_switch_conversation(win,
+ conversations->next->data);
+ } else {
+ gaim_conv_window_switch_conversation(win,
+ g_list_first(conversations)->data);
+ }
- gaim_conv_window_switch_conversation(win, index);
+ return;
+ }
+ }
}
void