Mercurial > pidgin
comparison src/gtkmain.c @ 10307:2ac21bf20e04
[gaim-migrate @ 11497]
And another one gone, and another one gone, another one bites the dust.
Hopefully I'm committing everything this time.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 03 Dec 2004 02:46:34 +0000 |
parents | 56cc5d49472b |
children | deec4b58d516 |
comparison
equal
deleted
inserted
replaced
10306:56cc5d49472b | 10307:2ac21bf20e04 |
---|---|
81 GtkWidget *mainwindow = NULL; | 81 GtkWidget *mainwindow = NULL; |
82 | 82 |
83 int opt_away = 0; | 83 int opt_away = 0; |
84 int docklet_count = 0; | 84 int docklet_count = 0; |
85 char *opt_away_arg = NULL; | 85 char *opt_away_arg = NULL; |
86 int opt_debug = 0; | |
87 | 86 |
88 #if HAVE_SIGNAL_H | 87 #if HAVE_SIGNAL_H |
89 /* | 88 /* |
90 * Lists of signals we wish to catch and those we wish to ignore. | 89 * Lists of signals we wish to catch and those we wish to ignore. |
91 * Each list terminated with -1 | 90 * Each list terminated with -1 |
652 void (*prev_sig_disp)(); | 651 void (*prev_sig_disp)(); |
653 #endif | 652 #endif |
654 int opt, opt_user = 0; | 653 int opt, opt_user = 0; |
655 int i; | 654 int i; |
656 gboolean gui_check; | 655 gboolean gui_check; |
656 gboolean debug_enabled; | |
657 gchar *gaimrc, *accountsxml; | 657 gchar *gaimrc, *accountsxml; |
658 | 658 |
659 struct option long_options[] = { | 659 struct option long_options[] = { |
660 {"acct", no_argument, NULL, 'a'}, | 660 {"acct", no_argument, NULL, 'a'}, |
661 /*{"away", optional_argument, NULL, 'w'}, */ | 661 /*{"away", optional_argument, NULL, 'w'}, */ |
669 {"session", required_argument, NULL, 's'}, | 669 {"session", required_argument, NULL, 's'}, |
670 {0, 0, 0, 0} | 670 {0, 0, 0, 0} |
671 }; | 671 }; |
672 | 672 |
673 #ifdef DEBUG | 673 #ifdef DEBUG |
674 opt_debug = 1; | 674 debug_enabled = TRUE; |
675 #endif | 675 #else |
676 debug_enabled = FALSE; | |
677 #endif | |
678 | |
676 #ifndef _WIN32 | 679 #ifndef _WIN32 |
677 br_set_locate_fallback_func(gaim_find_binary_location, argv[0]); | 680 br_set_locate_fallback_func(gaim_find_binary_location, argv[0]); |
678 #endif | 681 #endif |
679 #ifdef ENABLE_NLS | 682 #ifdef ENABLE_NLS |
680 bindtextdomain(PACKAGE, LOCALEDIR); | 683 bindtextdomain(PACKAGE, LOCALEDIR); |
718 | 721 |
719 if (sigprocmask(SIG_UNBLOCK, &sigset, NULL)) { | 722 if (sigprocmask(SIG_UNBLOCK, &sigset, NULL)) { |
720 char errmsg[BUFSIZ]; | 723 char errmsg[BUFSIZ]; |
721 snprintf(errmsg, BUFSIZ, "Warning: couldn't unblock signals"); | 724 snprintf(errmsg, BUFSIZ, "Warning: couldn't unblock signals"); |
722 perror(errmsg); | 725 perror(errmsg); |
723 } | 726 } |
724 #endif | 727 #endif |
725 | 728 |
726 for (i = 0; i < argc; i++) { | 729 for (i = 0; i < argc; i++) { |
727 /* --login option */ | 730 /* --login option */ |
728 if (strstr(argv[i], "--l") == argv[i]) { | 731 if (strstr(argv[i], "--l") == argv[i]) { |
799 | 802 |
800 /* scan command-line options */ | 803 /* scan command-line options */ |
801 opterr = 1; | 804 opterr = 1; |
802 while ((opt = getopt_long(argc, argv, | 805 while ((opt = getopt_long(argc, argv, |
803 #ifndef _WIN32 | 806 #ifndef _WIN32 |
804 "adhu:c:vns:", | 807 "adhu:c:vns:", |
805 #else | 808 #else |
806 "adhu:c:vn", | 809 "adhu:c:vn", |
807 #endif | 810 #endif |
808 long_options, NULL)) != -1) { | 811 long_options, NULL)) != -1) { |
809 switch (opt) { | 812 switch (opt) { |
810 case 'u': /* set user */ | 813 case 'u': /* set user */ |
811 opt_user = 1; | 814 opt_user = 1; |
813 break; | 816 break; |
814 case 'a': /* account editor */ | 817 case 'a': /* account editor */ |
815 opt_acct = 1; | 818 opt_acct = 1; |
816 break; | 819 break; |
817 case 'd': /* debug */ | 820 case 'd': /* debug */ |
818 opt_debug = 1; | 821 debug_enabled = TRUE; |
819 break; | 822 break; |
820 case 'c': /* use specified config dir */ | 823 case 'c': /* use specified config dir */ |
821 set_gaim_user_dir(optarg); | 824 set_gaim_user_dir(optarg); |
822 opt_config_dir_arg = g_strdup(optarg); | 825 opt_config_dir_arg = g_strdup(optarg); |
823 break; | 826 break; |
872 "Initialization of the Gaim core failed. Dumping core.\n" | 875 "Initialization of the Gaim core failed. Dumping core.\n" |
873 "Please report this!\n"); | 876 "Please report this!\n"); |
874 abort(); | 877 abort(); |
875 } | 878 } |
876 | 879 |
880 gaim_debug_set_enabled(debug_enabled); | |
881 | |
877 plugin_search_paths[0] = g_strdup(LIBDIR); | 882 plugin_search_paths[0] = g_strdup(LIBDIR); |
878 plugin_search_paths[1] = gaim_user_dir(); | 883 plugin_search_paths[1] = gaim_user_dir(); |
879 plugin_search_paths[2] = g_build_filename(gaim_user_dir(), "plugins", NULL); | 884 plugin_search_paths[2] = g_build_filename(gaim_user_dir(), "plugins", NULL); |
880 | 885 |
881 gaim_plugins_set_search_paths(sizeof(plugin_search_paths) / | 886 gaim_plugins_set_search_paths(sizeof(plugin_search_paths) / |
901 | 906 |
902 gaim_set_blist(gaim_blist_new()); | 907 gaim_set_blist(gaim_blist_new()); |
903 gaim_blist_load(); | 908 gaim_blist_load(); |
904 | 909 |
905 gaim_prefs_load(); | 910 gaim_prefs_load(); |
906 | |
907 gaim_prefs_update_old(); | 911 gaim_prefs_update_old(); |
908 gaim_gtk_prefs_update_old(); | 912 gaim_gtk_prefs_update_old(); |
909 | 913 |
910 /* load plugins we had when we quit */ | 914 /* load plugins we had when we quit */ |
911 gaim_plugins_load_saved("/gaim/gtk/plugins/loaded"); | 915 gaim_plugins_load_saved("/gaim/gtk/plugins/loaded"); |
920 #endif | 924 #endif |
921 if (opt_session_arg != NULL) { | 925 if (opt_session_arg != NULL) { |
922 g_free(opt_session_arg); | 926 g_free(opt_session_arg); |
923 opt_session_arg = NULL; | 927 opt_session_arg = NULL; |
924 } | 928 } |
925 | 929 |
926 if (opt_config_dir_arg != NULL) { | 930 if (opt_config_dir_arg != NULL) { |
927 g_free(opt_config_dir_arg); | 931 g_free(opt_config_dir_arg); |
928 opt_config_dir_arg = NULL; | 932 opt_config_dir_arg = NULL; |
929 } | 933 } |
930 | 934 |