pidgin/pidginaccountstore.c

branch
gtk4
changeset 41575
d08b9a655b0e
parent 41209
909561f42b1f
child 41607
8d14b5f6585e
equal deleted inserted replaced
41574:5c79e2bb862b 41575:d08b9a655b0e
35 *****************************************************************************/ 35 *****************************************************************************/
36 static void 36 static void
37 pidgin_account_store_add_account(PidginAccountStore *store, 37 pidgin_account_store_add_account(PidginAccountStore *store,
38 PurpleAccount *account) 38 PurpleAccount *account)
39 { 39 {
40 PurpleProtocol *protocol = NULL;
40 GtkTreeIter iter; 41 GtkTreeIter iter;
41 GdkPixbuf *pixbuf = NULL; 42 GdkPixbuf *pixbuf = NULL;
42 gchar *markup = NULL; 43 gchar *markup = NULL;
43 const gchar *alias = NULL; 44 const gchar *alias = NULL, *icon_name = NULL;
44 45
45 pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_SMALL); 46 protocol = purple_account_get_protocol(account);
47 icon_name = purple_protocol_get_icon_name(protocol);
46 48
47 alias = purple_account_get_private_alias(account); 49 alias = purple_account_get_private_alias(account);
48 if(alias != NULL) { 50 if(alias != NULL) {
49 markup = g_strdup_printf(_("%s (%s) (%s)"), 51 markup = g_strdup_printf(_("%s (%s) (%s)"),
50 purple_account_get_username(account), 52 purple_account_get_username(account),
60 gtk_list_store_set( 62 gtk_list_store_set(
61 GTK_LIST_STORE(store), 63 GTK_LIST_STORE(store),
62 &iter, 64 &iter,
63 PIDGIN_ACCOUNT_STORE_COLUMN_ACCOUNT, account, 65 PIDGIN_ACCOUNT_STORE_COLUMN_ACCOUNT, account,
64 PIDGIN_ACCOUNT_STORE_COLUMN_MARKUP, markup, 66 PIDGIN_ACCOUNT_STORE_COLUMN_MARKUP, markup,
65 PIDGIN_ACCOUNT_STORE_COLUMN_ICON, pixbuf, 67 PIDGIN_ACCOUNT_STORE_COLUMN_ICON_NAME, icon_name,
66 -1 68 -1
67 ); 69 );
68 70
69 g_clear_object(&pixbuf);
70 g_free(markup); 71 g_free(markup);
71 } 72 }
72 73
73 static void 74 static void
74 pidgin_account_store_add_account_helper(PurpleAccount *account, gpointer data) { 75 pidgin_account_store_add_account_helper(PurpleAccount *account, gpointer data) {
148 pidgin_account_store_init(PidginAccountStore *store) { 149 pidgin_account_store_init(PidginAccountStore *store) {
149 gpointer accounts_handle = NULL; 150 gpointer accounts_handle = NULL;
150 GType types[PIDGIN_ACCOUNT_STORE_N_COLUMNS] = { 151 GType types[PIDGIN_ACCOUNT_STORE_N_COLUMNS] = {
151 PURPLE_TYPE_ACCOUNT, 152 PURPLE_TYPE_ACCOUNT,
152 G_TYPE_STRING, 153 G_TYPE_STRING,
153 GDK_TYPE_PIXBUF, 154 G_TYPE_STRING,
154 }; 155 };
155 156
156 gtk_list_store_set_column_types( 157 gtk_list_store_set_column_types(
157 GTK_LIST_STORE(store), 158 GTK_LIST_STORE(store),
158 PIDGIN_ACCOUNT_STORE_N_COLUMNS, 159 PIDGIN_ACCOUNT_STORE_N_COLUMNS,

mercurial