Mercurial > pidgin.yaz
comparison src/account.c @ 5580:86456ec3ca25
[gaim-migrate @ 5984]
More nifty stuff! Accounts now get converted, and other niceties.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 31 May 2003 02:27:03 +0000 |
parents | a95e872e58dc |
children | 3a9b54f260e3 |
comparison
equal
deleted
inserted
replaced
5579:e0146fcc4718 | 5580:86456ec3ca25 |
---|---|
34 #include "account.h" | 34 #include "account.h" |
35 #include "prefs.h" | 35 #include "prefs.h" |
36 | 36 |
37 typedef enum | 37 typedef enum |
38 { | 38 { |
39 TAG_NONE = 0, | |
39 TAG_PROTOCOL, | 40 TAG_PROTOCOL, |
40 TAG_NAME, | 41 TAG_NAME, |
41 TAG_PASSWORD, | 42 TAG_PASSWORD, |
42 TAG_ALIAS, | 43 TAG_ALIAS, |
43 TAG_USERINFO, | 44 TAG_USERINFO, |
583 | 584 |
584 g_free(data->setting_name); | 585 g_free(data->setting_name); |
585 data->setting_name = NULL; | 586 data->setting_name = NULL; |
586 } | 587 } |
587 | 588 |
589 data->tag = TAG_NONE; | |
590 | |
588 g_free(buffer); | 591 g_free(buffer); |
589 } | 592 } |
590 | 593 |
591 static void | 594 static void |
592 __text_handler(GMarkupParseContext *context, const gchar *text, | 595 __text_handler(GMarkupParseContext *context, const gchar *text, |
791 | 794 |
792 g_free(filename); | 795 g_free(filename); |
793 g_free(filename_real); | 796 g_free(filename_real); |
794 } | 797 } |
795 | 798 |
799 void | |
800 gaim_accounts_reorder(GaimAccount *account, size_t new_index) | |
801 { | |
802 size_t index; | |
803 GList *l; | |
804 | |
805 g_return_if_fail(account != NULL); | |
806 g_return_if_fail(new_index > 0 && new_index < g_list_length(accounts)); | |
807 | |
808 index = g_list_index(accounts, account); | |
809 | |
810 if (index == -1) { | |
811 gaim_debug(GAIM_DEBUG_ERROR, "accounts", | |
812 "Unregistered account (%s) discovered during reorder!\n", | |
813 gaim_account_get_username(account)); | |
814 return; | |
815 } | |
816 | |
817 l = g_list_nth(accounts, index); | |
818 | |
819 if (new_index > index) | |
820 new_index--; | |
821 | |
822 /* Remove the old one. */ | |
823 accounts = g_list_delete_link(accounts, l); | |
824 | |
825 /* Insert it where it should go. */ | |
826 accounts = g_list_insert(accounts, account, new_index); | |
827 | |
828 schedule_accounts_save(); | |
829 } | |
796 | 830 |
797 GList * | 831 GList * |
798 gaim_accounts_get_all(void) | 832 gaim_accounts_get_all(void) |
799 { | 833 { |
800 return accounts; | 834 return accounts; |