]> arthur.barton.de Git - netatalk.git/commitdiff
Spotlight: call g_type_init() if glib is older then 2.36
authorRalph Boehme <rb@sernet.de>
Mon, 11 Aug 2014 14:29:17 +0000 (16:29 +0200)
committerRalph Boehme <rb@sernet.de>
Mon, 11 Aug 2014 14:29:17 +0000 (16:29 +0200)
Signed-off-by: Ralph Boehme <rb@sernet.de>
etc/afpd/spotlight.c

index f62ac6dd8aecb18411150df705206eff94d862ea..5404f9f8d1171914030d67caf1ad414e1e7ab386 100644 (file)
@@ -42,6 +42,8 @@
 #include "directory.h"
 #include "etc/spotlight/sparql_parser.h"
 
+#include <glib.h>
+
 #define MAX_SL_RESULTS 20
 
 struct slq_state_names {
@@ -1285,6 +1287,9 @@ int spotlight_init(AFPObj *obj)
     /*
      * Tracker uses glibs event dispatching, so we need a mainloop
      */
+#if ((GLIB_MAJOR_VERSION <= 2) && (GLIB_MINOR_VERSION < 36))
+        g_type_init();
+#endif
     sl_ctx->mainloop = g_main_loop_new(NULL, false);
     sl_ctx->cancellable = g_cancellable_new();