X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fgis-plugin.c;h=2e0ef1bdf8b0a802fd4b226f4b1e2a58eeb916f7;hb=c9865c176b97e2082a998b439ec51c31832e55f6;hp=57ad922427582cdab19e52235148e83eba53f421;hpb=6ed798102c4b8c630188f1683e040e5d25128370;p=grits diff --git a/src/gis-plugin.c b/src/gis-plugin.c index 57ad922..2e0ef1b 100644 --- a/src/gis-plugin.c +++ b/src/gis-plugin.c @@ -108,7 +108,7 @@ GList *gis_plugins_available(GisPlugins *self) g_debug(" checking %s", dirs[i]); const gchar *name; while ((name = g_dir_read_name(dir))) { - if (g_pattern_match_simple("*.so", name)) { + if (g_pattern_match_simple("*." G_MODULE_SUFFIX, name)) { gchar **parts = g_strsplit(name, ".", 2); list = g_list_prepend(list, g_strdup(parts[0])); g_strfreev(parts); @@ -119,7 +119,7 @@ GList *gis_plugins_available(GisPlugins *self) } GisPlugin *gis_plugins_load(GisPlugins *self, const char *name, - GisWorld *world, GisView *view, GisOpenGL *opengl, GisPrefs *prefs) + GisViewer *viewer, GisPrefs *prefs) { g_debug("GisPlugins: load %s", name); gchar *path = g_strdup_printf("%s/%s.%s", self->dir, name, G_MODULE_SUFFIX); @@ -155,7 +155,7 @@ GisPlugin *gis_plugins_load(GisPlugins *self, const char *name, GisPluginStore *store = g_new0(GisPluginStore, 1); store->name = g_strdup(name); - store->plugin = constructor(world, view, opengl, prefs); + store->plugin = constructor(viewer, prefs); g_ptr_array_add(self->plugins, store); return store->plugin; } @@ -177,6 +177,8 @@ gboolean gis_plugins_unload(GisPlugins *self, const char *name) void gis_plugins_foreach(GisPlugins *self, GCallback _callback, gpointer user_data) { g_debug("GisPlugins: foreach"); + if (self == NULL) + return; typedef void (*CBFunc)(GisPlugin *, const gchar *, gpointer); CBFunc callback = (CBFunc)_callback; for (int i = 0; i < self->plugins->len; i++) {