- const gchar *name;
- while ((name = g_dir_read_name(dir))) {
- if (g_pattern_match_simple("*.so", name)) {
- gchar **parts = g_strsplit(name, ".", 2);
- list = g_list_prepend(list, g_strdup(parts[0]));
- g_strfreev(parts);
+ gchar *dirs[] = {self->dir, PLUGINSDIR};
+ for (int i = 0; i<2; i++) {
+ GDir *dir = g_dir_open(dirs[i], 0, NULL);
+ if (dir == NULL)
+ continue;
+ g_debug(" checking %s", dirs[i]);
+ const gchar *name;
+ while ((name = g_dir_read_name(dir))) {
+ if (g_pattern_match_simple("*.so", name)) {
+ gchar **parts = g_strsplit(name, ".", 2);
+ list = g_list_prepend(list, g_strdup(parts[0]));
+ g_strfreev(parts);
+ }