+static char *trackerd_loglev;
+
+/******************************************************************
+ * Misc stuff
+ ******************************************************************/
+
+/* Set Tracker Miners to index all our volumes */
+static int set_sl_volumes(void)
+{
+ EC_INIT;
+ const struct vol *volumes, *vol;
+ struct bstrList *vollist = bstrListCreate();
+ bstring sep = bfromcstr(", ");
+ bstring volnamelist = NULL, cmd = NULL;
+
+ EC_NULL_LOG( volumes = getvolumes() );
+
+ for (vol = volumes; vol; vol = vol->v_next) {
+ if (vol->v_flags & AFPVOL_SPOTLIGHT) {
+ bstring volnamequot = bformat("'%s'", vol->v_path);
+ bstrListPush(vollist, volnamequot);
+ }
+ }
+
+ volnamelist = bjoin(vollist, sep);
+ cmd = bformat("gsettings set org.freedesktop.Tracker.Miner.Files index-recursive-directories \"[%s]\"",
+ bdata(volnamelist) ? bdata(volnamelist) : "");
+ LOG(log_debug, logtype_sl, "set_sl_volumes: %s", bdata(cmd));
+ system(bdata(cmd));
+
+ /* Disable default root user home indexing */
+ system("gsettings set org.freedesktop.Tracker.Miner.Files index-single-directories \"[]\"");
+
+EC_CLEANUP:
+ if (cmd)
+ bdestroy(cmd);
+ if (sep)
+ bdestroy(sep);
+ if (vollist)
+ bstrListDestroy(vollist);
+ if (volnamelist)
+ bdestroy(volnamelist);
+ EC_EXIT;
+}