| 123 purple_account_set_enabled(account, PIDGIN_UI, TRUE); |
123 purple_account_set_enabled(account, PIDGIN_UI, TRUE); |
| 124 } |
124 } |
| 125 } |
125 } |
| 126 g_strfreev(names); |
126 g_strfreev(names); |
| 127 } else { /* no name given, use the first account */ |
127 } else { /* no name given, use the first account */ |
| 128 GList *accounts; |
128 const GList *accounts; |
| 129 |
129 |
| 130 accounts = purple_accounts_get_all(); |
130 accounts = purple_accounts_get_all(); |
| 131 if (accounts != NULL) |
131 if (accounts != NULL) |
| 132 { |
132 { |
| 133 account = (PurpleAccount *)accounts->data; |
133 account = (PurpleAccount *)accounts->data; |
| 433 gboolean opt_version = FALSE; |
433 gboolean opt_version = FALSE; |
| 434 char *opt_config_dir_arg = NULL; |
434 char *opt_config_dir_arg = NULL; |
| 435 char *opt_login_arg = NULL; |
435 char *opt_login_arg = NULL; |
| 436 char *opt_session_arg = NULL; |
436 char *opt_session_arg = NULL; |
| 437 char *search_path; |
437 char *search_path; |
| 438 GList *accounts; |
438 const GList *accounts; |
| 439 #ifdef HAVE_SIGNAL_H |
439 #ifdef HAVE_SIGNAL_H |
| 440 int sig_indx; /* for setting up signal catching */ |
440 int sig_indx; /* for setting up signal catching */ |
| 441 sigset_t sigset; |
441 sigset_t sigset; |
| 442 RETSIGTYPE (*prev_sig_disp)(int); |
442 RETSIGTYPE (*prev_sig_disp)(int); |
| 443 char errmsg[BUFSIZ]; |
443 char errmsg[BUFSIZ]; |
| 448 #endif |
448 #endif |
| 449 int opt; |
449 int opt; |
| 450 gboolean gui_check; |
450 gboolean gui_check; |
| 451 gboolean debug_enabled; |
451 gboolean debug_enabled; |
| 452 gboolean migration_failed = FALSE; |
452 gboolean migration_failed = FALSE; |
| |
453 GList *active_accounts; |
| 453 |
454 |
| 454 struct option long_options[] = { |
455 struct option long_options[] = { |
| 455 {"config", required_argument, NULL, 'c'}, |
456 {"config", required_argument, NULL, 'c'}, |
| 456 {"debug", no_argument, NULL, 'd'}, |
457 {"debug", no_argument, NULL, 'd'}, |
| 457 {"help", no_argument, NULL, 'h'}, |
458 {"help", no_argument, NULL, 'h'}, |
| 725 g_free(segfault_message); |
726 g_free(segfault_message); |
| 726 #endif |
727 #endif |
| 727 abort(); |
728 abort(); |
| 728 } |
729 } |
| 729 |
730 |
| |
731 if (!purple_core_ensure_single_instance()) { |
| |
732 purple_core_quit(); |
| |
733 #ifdef HAVE_SIGNAL_H |
| |
734 g_free(segfault_message); |
| |
735 #endif |
| |
736 return 0; |
| |
737 } |
| |
738 |
| |
739 |
| 730 /* TODO: Move blist loading into purple_blist_init() */ |
740 /* TODO: Move blist loading into purple_blist_init() */ |
| 731 purple_set_blist(purple_blist_new()); |
741 purple_set_blist(purple_blist_new()); |
| 732 purple_blist_load(); |
742 purple_blist_load(); |
| 733 |
743 |
| 734 /* TODO: Move prefs loading into purple_prefs_init() */ |
744 /* TODO: Move prefs loading into purple_prefs_init() */ |
| 820 if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) |
830 if (!purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) |
| 821 purple_savedstatus_activate(purple_savedstatus_get_startup()); |
831 purple_savedstatus_activate(purple_savedstatus_get_startup()); |
| 822 purple_accounts_restore_current_statuses(); |
832 purple_accounts_restore_current_statuses(); |
| 823 } |
833 } |
| 824 |
834 |
| 825 if ((accounts = purple_accounts_get_all_active()) == NULL) |
835 if ((active_accounts = purple_accounts_get_all_active()) == NULL) |
| 826 { |
836 { |
| 827 pidgin_accounts_window_show(); |
837 pidgin_accounts_window_show(); |
| 828 } |
838 } |
| 829 else |
839 else |
| 830 { |
840 { |
| 831 g_list_free(accounts); |
841 g_list_free(active_accounts); |
| 832 } |
842 } |
| 833 |
843 |
| 834 #ifdef HAVE_STARTUP_NOTIFICATION |
844 #ifdef HAVE_STARTUP_NOTIFICATION |
| 835 startup_notification_complete(); |
845 startup_notification_complete(); |
| 836 #endif |
846 #endif |