Mercurial > pidgin.yaz
comparison pidgin/gtkblist.c @ 23480:2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
author | Justin Rodriguez <ffdragon@soc.pidgin.im> |
---|---|
date | Fri, 18 Jul 2008 09:03:40 +0000 |
parents | edb03a8d54bd |
children | fc3600ba68f1 |
comparison
equal
deleted
inserted
replaced
23479:edb03a8d54bd | 23480:2ccad3a8d9fe |
---|---|
5978 gchar *title; | 5978 gchar *title; |
5979 gboolean biglist; | 5979 gboolean biglist; |
5980 GtkTreeIter iter; | 5980 GtkTreeIter iter; |
5981 GtkTreePath *path; | 5981 GtkTreePath *path; |
5982 gboolean expanded; | 5982 gboolean expanded; |
5983 GdkColor bgcolor; | 5983 GdkColor *bgcolor; |
5984 GdkPixbuf *avatar = NULL; | 5984 GdkPixbuf *avatar = NULL; |
5985 PidginBlistTheme *theme; | 5985 PidginBlistTheme *theme; |
5986 | 5986 |
5987 if(!insert_node(list, gnode, &iter)) | 5987 if(!insert_node(list, gnode, &iter)) |
5988 return; | 5988 return; |
5989 | 5989 |
5990 theme = pidgin_blist_get_theme(); | 5990 theme = pidgin_blist_get_theme(); |
5991 | 5991 |
5992 /*if(theme == NULL){ | 5992 /*if(theme == NULL){ |
5993 bgcolor = &(gtkblist->treeview->style->bg[GTK_STATE_ACTIVE]); | 5993 bgcolor = &(gtkblist->treeview->style->bg[GTK_STATE_ACTIVE]); |
5994 | 5994 g_print("\nNULL\n"); |
5995 } | 5995 } |
5996 else if(purple_blist_node_get_bool(gnode, "collapsed")) | 5996 else if(purple_blist_node_get_bool(gnode, "collapsed")) |
5997 bgcolor = (pidgin_blist_theme_get_collapsed_text_info(theme))->color; | 5997 bgcolor = (pidgin_blist_theme_get_collapsed_text_info(theme))->color; |
5998 else bgcolor = (pidgin_blist_theme_get_expanded_text_info(theme))->color;*/ | 5998 else bgcolor = (pidgin_blist_theme_get_expanded_text_info(theme))->color; |
5999 | 5999 |
6000 g_print("\n\n\%s\n\n", gdk_color_to_string(&bgcolor)); | 6000 g_print("\n\n\%s\n\n", gdk_color_to_string(&bgcolor));*/ |
6001 | 6001 |
6002 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); | 6002 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
6003 expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(gtkblist->treeview), path); | 6003 expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(gtkblist->treeview), path); |
6004 gtk_tree_path_free(path); | 6004 gtk_tree_path_free(path); |
6005 | 6005 |
7189 | 7189 |
7190 void | 7190 void |
7191 pidgin_blist_set_theme(PidginBlistTheme *theme) | 7191 pidgin_blist_set_theme(PidginBlistTheme *theme) |
7192 { | 7192 { |
7193 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); | 7193 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
7194 | 7194 |
7195 g_return_if_fail(PIDGIN_IS_BLIST_THEME(theme)); | 7195 if (theme != NULL) |
7196 | 7196 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/theme", |
7197 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/theme", | |
7198 purple_theme_get_name(PURPLE_THEME(theme))); | 7197 purple_theme_get_name(PURPLE_THEME(theme))); |
7198 else purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/theme", ""); | |
7199 | |
7199 priv->current_theme = theme; | 7200 priv->current_theme = theme; |
7200 | 7201 |
7201 pidgin_blist_refresh(purple_get_blist()); | 7202 pidgin_blist_refresh(purple_get_blist()); |
7202 } | 7203 } |
7203 | 7204 |