Mercurial > audlegacy
comparison src/audacious/main.c @ 4575:92952061147d
Fix the initialization after messing it up myself - commandline argument handling was happening twice.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 21 May 2008 15:55:19 +0300 |
parents | 8084f49a930a |
children | ab8bc8a89a52 |
comparison
equal
deleted
inserted
replaced
4573:11f7874f3a95 | 4575:92952061147d |
---|---|
312 (*argv)[0], error->message, (*argv)[0]); | 312 (*argv)[0], error->message, (*argv)[0]); |
313 exit(EXIT_FAILURE); | 313 exit(EXIT_FAILURE); |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
317 static gboolean | 317 static void |
318 handle_cmd_line_options() | 318 handle_cmd_line_options() |
319 { | 319 { |
320 gchar **filenames = options.filenames; | 320 gchar **filenames = options.filenames; |
321 #ifdef USE_DBUS | 321 #ifdef USE_DBUS |
322 DBusGProxy *session = audacious_get_dbus_proxy(); | 322 DBusGProxy *session = audacious_get_dbus_proxy(); |
518 drct_main_win_toggle(TRUE); | 518 drct_main_win_toggle(TRUE); |
519 | 519 |
520 if (options.activate) | 520 if (options.activate) |
521 drct_activate(); | 521 drct_activate(); |
522 } /* !is_running */ | 522 } /* !is_running */ |
523 | |
524 #ifdef USE_DBUS | |
525 return is_running; | |
526 #else | |
527 return FALSE; | |
528 #endif | |
529 } | 523 } |
530 | 524 |
531 static void | 525 static void |
532 aud_setup_logger(void) | 526 aud_setup_logger(void) |
533 { | 527 { |
670 } | 664 } |
671 | 665 |
672 gint | 666 gint |
673 main(gint argc, gchar ** argv) | 667 main(gint argc, gchar ** argv) |
674 { | 668 { |
675 gboolean cmd_line_handled = FALSE; | |
676 | |
677 /* glib-2.13.0 requires g_thread_init() to be called before all | 669 /* glib-2.13.0 requires g_thread_init() to be called before all |
678 other GLib functions */ | 670 other GLib functions */ |
679 g_thread_init(NULL); | 671 g_thread_init(NULL); |
680 if (!g_thread_supported()) { | 672 if (!g_thread_supported()) { |
681 g_printerr(_("Sorry, threads aren't supported on your platform.\n")); | 673 g_printerr(_("Sorry, threads aren't supported on your platform.\n")); |
721 | 713 |
722 aud_config_load(); | 714 aud_config_load(); |
723 | 715 |
724 signal_handlers_init(); | 716 signal_handlers_init(); |
725 | 717 |
726 #ifdef USE_DBUS | 718 handle_cmd_line_options(); |
727 /* If we are using DBUS, handle options here */ | |
728 cmd_line_handled = handle_cmd_line_options(); | |
729 #endif | |
730 | 719 |
731 if (options.headless == FALSE) | 720 if (options.headless == FALSE) |
732 { | 721 { |
733 ui_main_check_theme_engine(); | 722 ui_main_check_theme_engine(); |
734 | 723 |
743 ui_manager_create_menus(); | 732 ui_manager_create_menus(); |
744 } | 733 } |
745 | 734 |
746 plugin_system_init(); | 735 plugin_system_init(); |
747 playlist_system_init(); | 736 playlist_system_init(); |
748 | |
749 if (!cmd_line_handled) | |
750 handle_cmd_line_options(); | |
751 | 737 |
752 #ifdef USE_DBUS | 738 #ifdef USE_DBUS |
753 init_dbus(); | 739 init_dbus(); |
754 #endif | 740 #endif |
755 | 741 |