# HG changeset patch # User Matti Hamalainen # Date 1211334192 -10800 # Node ID a6d0f9d6198a4cf1102d13bc22864472737193b6 # Parent cc6255f8b5680da1831a0bd8a0d07800ad4d992b Made handling of commandline options to happen before plugin and playlist initialization when DBus support is enabled. This makes handling of remote control options such as 'audacious -e foo' much faster. diff -r cc6255f8b568 -r a6d0f9d6198a src/audacious/main.c --- a/src/audacious/main.c Mon May 19 18:11:41 2008 +0200 +++ b/src/audacious/main.c Wed May 21 04:43:12 2008 +0300 @@ -314,7 +314,7 @@ } } -static void +static gboolean handle_cmd_line_options() { gchar **filenames = options.filenames; @@ -520,6 +520,12 @@ if (options.activate) drct_activate(); } /* !is_running */ + +#ifdef USE_DBUS + return is_running; +#else + return FALSE; +#endif } static void @@ -665,6 +671,8 @@ gint main(gint argc, gchar ** argv) { + gboolean cmd_line_handled = FALSE; + /* glib-2.13.0 requires g_thread_init() to be called before all other GLib functions */ g_thread_init(NULL); @@ -674,6 +682,7 @@ } gdk_threads_init(); + mowgli_init(); /* Setup l10n early so we can print localized error messages */ gtk_set_locale(); @@ -712,7 +721,11 @@ aud_config_load(); signal_handlers_init(); - mowgli_init(); + +#ifdef USE_DBUS + /* If we are using DBUS, handle options here */ + cmd_line_handled = handle_cmd_line_options(); +#endif if (options.headless == FALSE) { @@ -731,7 +744,9 @@ plugin_system_init(); playlist_system_init(); - handle_cmd_line_options(); + + if (!cmd_line_handled) + handle_cmd_line_options(); #ifdef USE_DBUS init_dbus();