daemon: warning and behave properly if no xdg-user-dirs setup.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Thu, 13 Feb 2014 16:02:22 +0000 (14:02 -0200)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Thu, 13 Feb 2014 16:02:22 +0000 (14:02 -0200)
src/bin/lightmediascannerd.c

index f439d94..bfe2a70 100644 (file)
@@ -1481,8 +1481,14 @@ _populate_dir_internal(const char *category, const char *dir)
             {NULL, NULL}
         };
         for (itr = defaults; itr->cat != NULL; itr++) {
-            if (strcmp(itr->cat, category) == 0)
-                scanner_category_add_dir(sc, itr->path);
+            if (strcmp(itr->cat, category) == 0) {
+                if (itr->path && itr->path[0] != '\0')
+                    scanner_category_add_dir(sc, itr->path);
+                else
+                    g_warning("Requested default directories but "
+                              "xdg-user-dirs is not setup. Category %s",
+                              category);
+            }
         }
     }
 }