pidgin/pidginaccountsdisabledmenu.c

changeset 42804
be8c8b5471ca
parent 42575
580339aa47cc
child 43062
9d134b69b834
equal deleted inserted replaced
42803:984f8dfabb47 42804:be8c8b5471ca
98 gint index, 98 gint index,
99 GHashTable **attributes) 99 GHashTable **attributes)
100 { 100 {
101 PidginAccountsDisabledMenu *menu = NULL; 101 PidginAccountsDisabledMenu *menu = NULL;
102 PurpleAccount *account = NULL; 102 PurpleAccount *account = NULL;
103 PurpleContactInfo *info = NULL;
104 PurpleProtocol *protocol = NULL; 103 PurpleProtocol *protocol = NULL;
105 GVariant *value = NULL; 104 GVariant *value = NULL;
106 const gchar *account_name = NULL, *protocol_name = NULL; 105 const gchar *account_name = NULL, *protocol_name = NULL;
107 106
108 menu = PIDGIN_ACCOUNTS_DISABLED_MENU(model); 107 menu = PIDGIN_ACCOUNTS_DISABLED_MENU(model);
129 account = g_list_nth_data(menu->accounts, index); 128 account = g_list_nth_data(menu->accounts, index);
130 if(account == NULL) { 129 if(account == NULL) {
131 return; 130 return;
132 } 131 }
133 132
134 info = PURPLE_CONTACT_INFO(account); 133 account_name = purple_account_get_username(account);
135 account_name = purple_contact_info_get_username(info);
136 protocol_name = purple_account_get_protocol_name(account); 134 protocol_name = purple_account_get_protocol_name(account);
137 135
138 /* translators: This format string is intended to contain the account 136 /* translators: This format string is intended to contain the account
139 * name followed by the protocol name to uniquely identify a specific 137 * name followed by the protocol name to uniquely identify a specific
140 * account. 138 * account.
145 143
146 value = g_variant_new_string("app.enable-account"); 144 value = g_variant_new_string("app.enable-account");
147 g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_ACTION, 145 g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_ACTION,
148 g_variant_ref_sink(value)); 146 g_variant_ref_sink(value));
149 147
150 value = g_variant_new_printf("%s", purple_contact_info_get_id(info)); 148 value = g_variant_new_printf("%s", purple_account_get_id(account));
151 g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_TARGET, 149 g_hash_table_insert(*attributes, G_MENU_ATTRIBUTE_TARGET,
152 g_variant_ref_sink(value)); 150 g_variant_ref_sink(value));
153 151
154 protocol = purple_account_get_protocol(account); 152 protocol = purple_account_get_protocol(account);
155 if(protocol != NULL) { 153 if(protocol != NULL) {

mercurial