]> arthur.barton.de Git - netatalk.git/commitdiff
Smarter spotlight option
authorRalph Boehme <sloowfranklin@gmail.com>
Tue, 18 Jun 2013 13:38:21 +0000 (15:38 +0200)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 18 Jun 2013 13:38:21 +0000 (15:38 +0200)
doc/manpages/man5/afp.conf.5.xml
doc/manual/configuration.xml
include/atalk/globals.h
libatalk/util/netatalk_conf.c

index de085ae26c423776be235875c281b99a210c752a..3d01b55e2e78a53865194c4e65b18cd7c7c7270b 100644 (file)
           <emphasis>no</emphasis>) <type>(G)/(V)</type></term>
 
           <listitem>
-            <para>Whether to enable Spotlight searches. Enable this global option
-            and then also add "spotlight = yes" to any volume you want to be able
-            to search with Spotlight. Note: once the global option is enabled, any
-            volume that is not enabled won't be searchable at all.</para>
+            <para>Whether to enable Spotlight searches. Note: once the global
+            option is enabled, any volume that is not enabled won't be
+            searchable at all.</para>
           </listitem>
         </varlistentry>
 
index 0054a0c0328ba4f10a46e251624a8a181e0e1e65..3116f7a0a8cd0cfa21cb8089fdc41b645e09e183 100644 (file)
@@ -138,34 +138,16 @@ basedir regex = /usr/home</programlisting></para>
       users are advised to install Tracker from OpenCSW as this is at least
       version 0.15 and thus supports SPARQL</para>
 
-      <para>To enable Spotlight put this in your afp.conf:</para>
+      <para>You can enable Spotlight and indexing either globally or on a per
+      volume basis using the <option>spotlight</option>.</para>
 
-      <screen>[Global]
-...
-spotlight = yes
-...</screen>
-
-      <para>This will enable Spotlight functionality. For Solaris with Tracker
-      from OpenCSW also add:<screen>dbus daemon = /opt/csw/bin/dbus-daemon</screen></para>
-
-      <sect3>
-        <title>Tracker SPARQL</title>
+      <para>For Solaris with Tracker from OpenCSW also add:
+      <screen>dbus daemon = /opt/csw/bin/dbus-daemon</screen></para>
 
-        <para>Next you must enbale Spotlight indexing on a per volume
-        basis:</para>
-
-        <screen>[foo]
-path = /bar
-spotlight = yes
-...</screen>
-
-        <para>Only volumes with a setting of spotlight = yes will be
-        searchable with Spotlight.</para>
-
-        <warning>
-          <para>All other volumes won't be searchable at all</para>
-        </warning>
-      </sect3>
+      <warning>
+        <para>Once Spotlight is enable for a single volume, all other volumes
+        won't be searchable at all.</para>
+      </warning>
 
       <sect3>
         <title>Tracker RDF</title>
index 1f6cd048982f84784d60c9693b6b4140b2b969de..232f5392a1dc52b0599394453f9723cdc2fad7da 100644 (file)
@@ -57,7 +57,8 @@
 #define OPTION_ACL2MODE      (1 << 10)
 #define OPTION_SHARE_RESERV  (1 << 11) /* whether to use Solaris fcntl F_SHARE locks */
 #define OPTION_DBUS_AFPSTATS (1 << 12) /* whether to run dbus thread for afpstats */
-#define OPTION_SPOTLIGHT     (1 << 13) /* whether to enable Spotlight support */
+#define OPTION_SPOTLIGHT     (1 << 13) /* whether to initialize Spotlight support */
+#define OPTION_SPOTLIGHT_VOL (1 << 14) /* whether spotlight shall be enabled by default for volumes */
 
 #define PASSWD_NONE     0
 #define PASSWD_SET     (1 << 0)
index 8b26ee8923b66fe2754e29664f113c02fb9d3292..26406e668e624b4b60b8ddc0f7b1405dfc4554ae 100644 (file)
@@ -772,8 +772,10 @@ 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))
+    if (getoption_bool(obj->iniconfig, section, "spotlight", preset, obj->options.flags & OPTION_SPOTLIGHT_VOL)) {
         volume->v_flags |= AFPVOL_SPOTLIGHT;
+        obj->options.flags |= OPTION_SPOTLIGHT;
+    }
 
     if (getoption_bool(obj->iniconfig, section, "preexec close", preset, 0))
         volume->v_preexec_close = 1;
@@ -1732,7 +1734,7 @@ int afp_config_parse(AFPObj *AFPObj, char *processname)
     if (iniparser_getboolean(config, INISEC_GLOBAL, "afp read locks", 0))
         options->flags |= OPTION_AFP_READ_LOCK;
     if (iniparser_getboolean(config, INISEC_GLOBAL, "spotlight", 0))
-        options->flags |= OPTION_SPOTLIGHT;
+        options->flags |= OPTION_SPOTLIGHT_VOL;
     if (!iniparser_getboolean(config, INISEC_GLOBAL, "save password", 1))
         options->passwdbits |= PASSWD_NOSAVE;
     if (iniparser_getboolean(config, INISEC_GLOBAL, "set password", 0))