comparison src/gtkmain.c @ 10581:59a2807e10bb

[gaim-migrate @ 11981] I'm not sure when using --class broke (though it was probably when we added -c) but this fixes it for me and is arguable more correct anyway since according to the gtk docs gtk_init (and gtk_init_check) "will initialize everything needed to operate the toolkit and parses some standard command line options. argc and argv are adjusted accordingly so your own code will never see those standard arguments." committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Tue, 08 Feb 2005 04:59:35 +0000
parents 77ef3f2f0df8
children 0f7452b1f777
comparison
equal deleted inserted replaced
10580:662a99c6701f 10581:59a2807e10bb
522 snprintf(errmsg, BUFSIZ, "Warning: couldn't unblock signals"); 522 snprintf(errmsg, BUFSIZ, "Warning: couldn't unblock signals");
523 perror(errmsg); 523 perror(errmsg);
524 } 524 }
525 #endif 525 #endif
526 526
527 gui_check = gtk_init_check(&argc, &argv);
528 if (!gui_check) {
529 char *display = gdk_get_display();
530
531 g_warning("cannot open display: %s", display ? display : "unset");
532 g_free(display);
533
534 return 1;
535 }
536
527 /* scan command-line options */ 537 /* scan command-line options */
528 opterr = 1; 538 opterr = 1;
529 while ((opt = getopt_long(argc, argv, 539 while ((opt = getopt_long(argc, argv,
530 #ifndef _WIN32 540 #ifndef _WIN32
531 "ac:dhnl::s:v", 541 "ac:dhnl::s:v",
583 } 593 }
584 594
585 /* set a user-specified config directory */ 595 /* set a user-specified config directory */
586 if (opt_config_dir_arg != NULL) { 596 if (opt_config_dir_arg != NULL) {
587 set_gaim_user_dir(opt_config_dir_arg); 597 set_gaim_user_dir(opt_config_dir_arg);
588 }
589
590 gui_check = gtk_init_check(&argc, &argv);
591 if (!gui_check) {
592 char *display = gdk_get_display();
593
594 g_warning("cannot open display: %s", display ? display : "unset");
595 g_free(display);
596
597 return 1;
598 } 598 }
599 599
600 /* 600 /*
601 * We're done piddling around with command line arguments. 601 * We're done piddling around with command line arguments.
602 * Fire up this baby. 602 * Fire up this baby.