--- navit/navit/start_real.c 2012/01/06 08:52:23 26 +++ navit/navit/start_real.c 2012/04/09 21:27:36 27 @@ -56,7 +56,7 @@ static void print_usage(void) { - printf(_("navit usage:\nnavit [options] [configfile]\n\t-c : use as config file\n\t-d : set the debug output level to . (TODO)\n\t-h: print this usage info and exit.\n\t-v: Print the version and exit.\n")); + printf("navit usage:\nnavit [options] [configfile]\n\t-c : use as config file\n\t-d : set the debug output level to . (TODO)\n\t-h: print this usage info and exit.\n\t-v: Print the version and exit.\n"); } @@ -146,26 +146,35 @@ } // if config file is explicitely given only look for it, otherwise try std paths - if (config_file) list = g_list_append(list,g_strdup(config_file)); - else { + if (config_file) + { + list = g_list_append(list,g_strdup(config_file)); + } + else + { + list = g_list_append(list,g_strjoin(NULL,getenv("NAVIT_USER_DATADIR"), "/navit.xml" , NULL)); - list = g_list_append(list,g_strdup("navit.xml.local")); list = g_list_append(list,g_strdup("navit.xml")); + #ifdef HAVE_API_ANDROID - // new preferred location (the new one should have priority over the legacy!) - list = g_list_append(list,g_strdup("/sdcard/zanavi/navit.xml")); + // **disabled** // new preferred location (the new one should have priority over the legacy!) + // **disabled** // list = g_list_append(list,g_strdup("/sdcard/zanavi/navit.xml")); #endif - list = g_list_append(list,g_strjoin(NULL,getenv("NAVIT_SHAREDIR"), "/navit.xml.local" , NULL)); + list = g_list_append(list,g_strjoin(NULL,getenv("NAVIT_SHAREDIR"), "/navit.xml" , NULL)); + #ifndef _WIN32 list = g_list_append(list,g_strdup("/etc/navit/navit.xml")); #endif + } li = list; - for (;;) { - if (li == NULL) { + for (;;) + { + if (li == NULL) + { // We have not found an existing config file from all possibilities - dbg(0,_("No config file navit.xml, navit.xml.local found\n")); + dbg(0,"No config file navit.xml, navit.xml.local found\n"); return 1; } // Try the next config file possibility from the list @@ -179,18 +188,18 @@ li = g_list_next(li); } - if (!config_load(config_file, &error)) { - dbg(0, _("Error parsing '%s': %s\n"), config_file, error ? error->message : ""); - } else { - dbg(0, _("Using '%s'\n"), config_file); + if (!config_load(config_file, &error)) + { } - while (li) { + + while (li) + { g_free(li->data); li = g_list_next(li); } g_list_free(list); if (! config_get_attr(config, attr_navit, &navit, NULL) && !config_empty_ok) { - dbg(0, _("No instance has been created, exiting\n")); + dbg(0, "No instance has been created, exiting\n"); exit(1); } event_main_loop_run();