Fix:core:Warn if no plugins are found, improve other warnings & debug output; see...
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 1 May 2012 17:17:19 +0000 (17:17 +0000)
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 1 May 2012 17:17:19 +0000 (17:17 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5064 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/navit.c
navit/navit/plugin.c

index ca67809..bf2178e 100644 (file)
@@ -1968,12 +1968,12 @@ navit_init(struct navit *this_)
        dbg(2,"enter gui %p graphics %p\n",this_->gui,this_->gra);
 
        if (!this_->gui && !(this_->flags & 2)) {
-               dbg(0,"no gui\n");
+               dbg(0,"Warning: No GUI available.\n");
                navit_destroy(this_);
                return;
        }
        if (!this_->gra && !(this_->flags & 1)) {
-               dbg(0,"no graphics\n");
+               dbg(0,"Warning: No graphics subsystem available.\n");
                navit_destroy(this_);
                return;
        }
index 7829172..9ab56b4 100644 (file)
@@ -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
 }