Mercurial > pidgin.yaz
comparison src/gtklog.c @ 7440:8c0527c91a92
[gaim-migrate @ 8045]
this is all more better, but i forget what it all is.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 05 Nov 2003 23:43:53 +0000 |
parents | 7cdbd2eb7546 |
children | 50f4386a8262 |
comparison
equal
deleted
inserted
replaced
7439:3a51b301a805 | 7440:8c0527c91a92 |
---|---|
36 struct log_viewer_hash_t { | 36 struct log_viewer_hash_t { |
37 char *screenname; | 37 char *screenname; |
38 GaimAccount *account; | 38 GaimAccount *account; |
39 }; | 39 }; |
40 | 40 |
41 static guint log_viewer_hash(const struct log_viewer_hash_t *viewer) | 41 static guint log_viewer_hash(gconstpointer data) |
42 { | 42 { |
43 const struct log_viewer_hash_t *viewer = data; | |
43 return g_str_hash(viewer->screenname) + g_str_hash(gaim_account_get_username(viewer->account)); | 44 return g_str_hash(viewer->screenname) + g_str_hash(gaim_account_get_username(viewer->account)); |
44 | 45 |
45 } | 46 } |
46 | 47 |
47 static gint log_viewer_equal(const struct log_viewer_hash_t *a, const struct log_viewer_hash_t *b) | 48 static gint log_viewer_equal(gconstpointer y, gconstpointer z) |
48 { | 49 { |
50 const struct log_viewer_hash_t *a, *b; | |
49 int ret; | 51 int ret; |
50 char *normal = g_strdup(gaim_normalize(a->account, a->screenname)); | 52 char *normal; |
51 ret = (a->account == b->account) && !strcmp(normal, gaim_normalize(b->account, b->screenname)); | 53 |
54 a = y; | |
55 b = z; | |
56 | |
57 normal = g_strdup(gaim_normalize(a->account, a->screenname)); | |
58 ret = (a->account == b->account) && | |
59 !strcmp(normal, gaim_normalize(b->account, b->screenname)); | |
52 g_free(normal); | 60 g_free(normal); |
53 return ret; | 61 return ret; |
54 } | 62 } |
55 | 63 |
56 static void log_select(GtkTreeSelection *sel, GaimGtkLogViewer *viewer) { | 64 static void log_select(GtkTreeSelection *sel, GaimGtkLogViewer *viewer) { |
94 */ | 102 */ |
95 static void populate_log_tree(GaimGtkLogViewer *lv) | 103 static void populate_log_tree(GaimGtkLogViewer *lv) |
96 /* Logs are made from trees in real life. | 104 /* Logs are made from trees in real life. |
97 This is a tree made from logs */ | 105 This is a tree made from logs */ |
98 { | 106 { |
99 char *title[64]; | 107 char title[64]; |
100 GtkTreeIter iter; | 108 GtkTreeIter iter; |
101 GList *logs = lv->logs; | 109 GList *logs = lv->logs; |
102 while (logs) { | 110 while (logs) { |
103 GaimLog *log = logs->data; | 111 GaimLog *log = logs->data; |
104 strftime(title, sizeof(title), "%c", localtime(&log->time)); | 112 strftime(title, sizeof(title), "%c", localtime(&log->time)); |