From 5ebe419ded6f81cc67886f8e9df10aa428968f19 Mon Sep 17 00:00:00 2001 From: sleske Date: Tue, 1 May 2012 17:17:19 +0000 Subject: Fix:core:Warn if no plugins are found, improve other warnings & debug output; see #1030 git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5064 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/plugin.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'navit/plugin.c') diff --git a/navit/plugin.c b/navit/plugin.c index 782917233..9ab56b4bc 100644 --- a/navit/plugin.c +++ b/navit/plugin.c @@ -183,6 +183,7 @@ plugin_load(struct plugin *pl) g_module_close(mod); return 0; } else { + dbg(1, "loaded module %s\n", pl->name); pl->mod=mod; pl->init=init; } @@ -298,11 +299,11 @@ plugin_new(struct attr *parent, struct attr **attrs) { if (count != 1 || file_exists(array[0])) { for (i = 0 ; i < count ; i++) { name=array[i]; - dbg(2,"name[%d]='%s'\n", i, name); + dbg(2,"found plugin module file [%d]: '%s'\n", i, name); if (! (pls && (pl=g_hash_table_lookup(pls->hash, name)))) { pl=plugin_new_from_path(name); if (! pl) { - dbg(0,"failed to create plugin '%s'\n", name); + dbg(0,"failed to create plugin from file '%s'\n", name); continue; } if (pls) { @@ -341,16 +342,20 @@ plugins_init(struct plugins *pls) GList *l; l=pls->list; - while (l) { - pl=l->data; - if (! plugin_get_ondemand(pl)) { - if (plugin_get_active(pl)) - if (!plugin_load(pl)) - plugin_set_active(pl, 0); - if (plugin_get_active(pl)) - plugin_call_init(pl); + if (l){ + while (l) { + pl=l->data; + if (! plugin_get_ondemand(pl)) { + if (plugin_get_active(pl)) + if (!plugin_load(pl)) + plugin_set_active(pl, 0); + if (plugin_get_active(pl)) + plugin_call_init(pl); + } + l=g_list_next(l); } - l=g_list_next(l); + } else { + dbg(0, "Warning: No plugins found. Is Navit installed correctly?\n"); } #endif } -- cgit v1.2.1