| 2181 |
2181 |
| 2182 set_account(accounts_window->model, &iter, account, global_buddyicon); |
2182 set_account(accounts_window->model, &iter, account, global_buddyicon); |
| 2183 } |
2183 } |
| 2184 |
2184 |
| 2185 static gboolean |
2185 static gboolean |
| 2186 populate_accounts_list(AccountsWindow *dialog) |
2186 populate_accounts_list(AccountsWindow *dialog) { |
| 2187 { |
|
| 2188 GList *l; |
2187 GList *l; |
| 2189 GdkPixbuf *global_buddyicon = NULL; |
2188 GdkPixbuf *global_buddyicon = NULL; |
| 2190 const char *path; |
2189 const gchar *path; |
| 2191 |
2190 |
| 2192 gtk_list_store_clear(dialog->model); |
2191 gtk_list_store_clear(dialog->model); |
| 2193 |
2192 |
| 2194 if ((path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) != NULL) { |
2193 path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon"); |
| |
2194 if(path != NULL && *path != '\0') { |
| 2195 GdkPixbuf *pixbuf = pidgin_pixbuf_new_from_file(path); |
2195 GdkPixbuf *pixbuf = pidgin_pixbuf_new_from_file(path); |
| 2196 if (pixbuf != NULL) { |
2196 if(pixbuf != NULL) { |
| 2197 global_buddyicon = gdk_pixbuf_scale_simple(pixbuf, 22, 22, GDK_INTERP_HYPER); |
2197 global_buddyicon = gdk_pixbuf_scale_simple(pixbuf, 22, 22, |
| |
2198 GDK_INTERP_HYPER); |
| 2198 g_object_unref(G_OBJECT(pixbuf)); |
2199 g_object_unref(G_OBJECT(pixbuf)); |
| 2199 } |
2200 } |
| 2200 } |
2201 } |
| 2201 |
2202 |
| 2202 l = purple_accounts_get_all(); |
2203 l = purple_accounts_get_all(); |
| 2203 g_list_foreach(l, (GFunc)add_account_to_liststore, global_buddyicon); |
2204 g_list_foreach(l, (GFunc)add_account_to_liststore, global_buddyicon); |
| 2204 |
2205 |
| 2205 if (global_buddyicon != NULL) |
2206 if(global_buddyicon != NULL) { |
| 2206 g_object_unref(G_OBJECT(global_buddyicon)); |
2207 g_object_unref(G_OBJECT(global_buddyicon)); |
| |
2208 } |
| 2207 |
2209 |
| 2208 return l != NULL; |
2210 return l != NULL; |
| 2209 } |
2211 } |
| 2210 |
2212 |
| 2211 static void |
2213 static void |