]> arthur.barton.de Git - netatalk.git/commitdiff
Add per volume spotlight option
authorRalph Boehme <sloowfranklin@gmail.com>
Mon, 3 Jun 2013 17:52:47 +0000 (19:52 +0200)
committerRalph Boehme <sloowfranklin@gmail.com>
Mon, 3 Jun 2013 17:52:47 +0000 (19:52 +0200)
etc/netatalk/netatalk.c
include/atalk/volume.h
libatalk/util/netatalk_conf.c

index b0407d0d5219d5760e3a5515435ec71017c08b31..3e3444f25af3bb7e7600dff5e8ec2412f31b9909 100644 (file)
@@ -78,8 +78,10 @@ static int set_sl_volumes(void)
     EC_NULL_LOG( volumes = getvolumes() );
 
     for (vol = volumes; vol; vol = vol->v_next) {
-        bstring volnamequot = bformat("'%s'", vol->v_path);
-        bstrListPush(vollist, volnamequot);
+        if (vol->v_flags & AFPVOL_SPOTLIGHT) {
+            bstring volnamequot = bformat("'%s'", vol->v_path);
+            bstrListPush(vollist, volnamequot);
+        }
     }
 
     volnamelist = bjoin(vollist, sep);
index b185f994c1e2a0f7b0175a1e28c32735a7e6fb70..0981ee9840e8508dfc5abab266898f2f7a90ad97 100644 (file)
@@ -117,6 +117,7 @@ struct vol {
   Keep in sync with libatalk/util/volinfo.c
 */
 #define AFPVOL_NOV2TOEACONV (1 << 5) /* no adouble:v2 to adouble:ea conversion */
+#define AFPVOL_SPOTLIGHT (1 << 6)   /* Index volume for Spotlight searches */
 #define AFPVOL_RO        (1 << 8)   /* read-only volume */
 #define AFPVOL_NOSTAT    (1 << 16)  /* advertise the volume even if we can't stat() it
                                      * maybe because it will be mounted later in preexec */
index 0259cb02e77bcfebc1410818c3455632dcf6f668..8b26ee8923b66fe2754e29664f113c02fb9d3292 100644 (file)
@@ -772,6 +772,8 @@ static struct vol *creatvol(AFPObj *obj,
         volume->v_flags |= AFPVOL_NOV2TOEACONV;
     if (getoption_bool(obj->iniconfig, section, "follow symlinks", preset, 0))
         volume->v_flags |= AFPVOL_FOLLOWSYM;
+    if (getoption_bool(obj->iniconfig, section, "spotlight", preset, 0))
+        volume->v_flags |= AFPVOL_SPOTLIGHT;
 
     if (getoption_bool(obj->iniconfig, section, "preexec close", preset, 0))
         volume->v_preexec_close = 1;