[tracker/wip/split/miner-fs: 1/6] libtracker-data: Move miner initialization funcs to libtracker-common



commit 02c72a254336850755bc93040797bf46ea1ec62c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Oct 28 01:05:55 2016 +0200

    libtracker-data: Move miner initialization funcs to libtracker-common

 src/libtracker-common/Makefile.am        |    2 +
 src/libtracker-common/tracker-common.h   |    1 +
 src/libtracker-common/tracker-init.c     |  273 ++++++++++++++++++++++++++++++
 src/libtracker-common/tracker-init.h     |   35 ++++
 src/libtracker-data/tracker-db-manager.c |  247 ---------------------------
 src/libtracker-data/tracker-db-manager.h |    8 -
 src/miners/fs/tracker-main.c             |   14 +-
 src/miners/fs/tracker-miner-files.c      |   10 +-
 src/tracker-extract/tracker-main.c       |    6 +-
 9 files changed, 323 insertions(+), 273 deletions(-)
---
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 68422e9..5f04b42 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -21,6 +21,7 @@ libtracker_common_LTLIBRARIES = libtracker-common.la
 
 libtracker_common_la_SOURCES = \
        $(BUILT_SOURCES) \
+       tracker-init.c \
        tracker-date-time.c \
        tracker-dbus.c \
        tracker-file-utils.c \
@@ -34,6 +35,7 @@ libtracker_common_la_SOURCES = \
        tracker-language.c
 
 noinst_HEADERS = \
+       tracker-init.h \
        tracker-dbus.h \
        tracker-enums.h \
        tracker-ioprio.h \
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index 1af7393..d1978d2 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -40,6 +40,7 @@
 #include "tracker-utils.h"
 #include "tracker-locale.h"
 #include "tracker-enum-types.h"
+#include "tracker-init.h"
 
 #undef __LIBTRACKER_COMMON_INSIDE__
 
diff --git a/src/libtracker-common/tracker-init.c b/src/libtracker-common/tracker-init.c
new file mode 100644
index 0000000..e9e2fd1
--- /dev/null
+++ b/src/libtracker-common/tracker-init.c
@@ -0,0 +1,273 @@
+/*
+ * Copyright (C) 2016 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "tracker-init.h"
+
+#include <errno.h>
+#include <glib/gstdio.h>
+
+/* Stamp files to know crawling/indexing state */
+#define FIRST_INDEX_FILENAME          "first-index.txt"
+#define LAST_CRAWL_FILENAME           "last-crawl.txt"
+#define NEED_MTIME_CHECK_FILENAME     "no-need-mtime-check.txt"
+
+inline static gchar *
+get_first_index_filename (void)
+{
+        return g_build_filename (g_get_user_cache_dir (),
+                                 "tracker",
+                                 FIRST_INDEX_FILENAME,
+                                 NULL);
+}
+
+/**
+ * tracker_init_get_first_index_done:
+ *
+ * Check if first full index of files was already done.
+ *
+ * Returns: %TRUE if a first full index have been done, %FALSE otherwise.
+ **/
+gboolean
+tracker_init_get_first_index_done (void)
+{
+        gboolean exists;
+        gchar *filename;
+
+        filename = get_first_index_filename ();
+        exists = g_file_test (filename, G_FILE_TEST_EXISTS);
+        g_free (filename);
+
+        return exists;
+}
+
+/**
+ * tracker_init_set_first_index_done:
+ *
+ * Set the status of the first full index of files. Should be set to
+ *  %FALSE if the index was never done or if a reindex is needed. When
+ *  the index is completed, should be set to %TRUE.
+ **/
+void
+tracker_init_set_first_index_done (gboolean done)
+{
+        gboolean already_exists;
+        gchar *filename;
+
+        filename = get_first_index_filename ();
+        already_exists = g_file_test (filename, G_FILE_TEST_EXISTS);
+
+        if (done && !already_exists) {
+                GError *error = NULL;
+
+                /* If done, create stamp file if not already there */
+                if (!g_file_set_contents (filename, PACKAGE_VERSION, -1, &error)) {
+                        g_warning ("  Could not create file:'%s' failed, %s",
+                                   filename,
+                                   error->message);
+                        g_error_free (error);
+                } else {
+                        g_message ("  First index file:'%s' created",
+                                   filename);
+                }
+        } else if (!done && already_exists) {
+                /* If NOT done, remove stamp file */
+                g_message ("  Removing first index file:'%s'", filename);
+
+                if (g_remove (filename)) {
+                        g_warning ("    Could not remove file:'%s', %m",
+                                   filename);
+                }
+        }
+
+        g_free (filename);
+}
+
+inline static gchar *
+get_last_crawl_filename (void)
+{
+        return g_build_filename (g_get_user_cache_dir (),
+                                 "tracker",
+                                 LAST_CRAWL_FILENAME,
+                                 NULL);
+}
+
+/**
+ * tracker_init_get_last_crawl_done:
+ *
+ * Check when last crawl was performed.
+ *
+ * Returns: time_t() value when last crawl occurred, otherwise 0.
+ **/
+guint64
+tracker_init_get_last_crawl_done (void)
+{
+        gchar *filename;
+        gchar *content;
+        guint64 then;
+
+        filename = get_last_crawl_filename ();
+
+        if (!g_file_get_contents (filename, &content, NULL, NULL)) {
+                g_message ("  No previous timestamp, crawling forced");
+                return 0;
+        }
+
+        then = g_ascii_strtoull (content, NULL, 10);
+        g_free (content);
+
+        return then;
+}
+
+/**
+ * tracker_db_manager_set_last_crawl_done:
+ *
+ * Set the status of the first full index of files. Should be set to
+ *  %FALSE if the index was never done or if a reindex is needed. When
+ *  the index is completed, should be set to %TRUE.
+ **/
+void
+tracker_init_set_last_crawl_done (gboolean done)
+{
+        gboolean already_exists;
+        gchar *filename;
+
+        filename = get_last_crawl_filename ();
+        already_exists = g_file_test (filename, G_FILE_TEST_EXISTS);
+
+        if (done && !already_exists) {
+                GError *error = NULL;
+                gchar *content;
+
+                content = g_strdup_printf ("%" G_GUINT64_FORMAT, (guint64) time (NULL));
+
+                /* If done, create stamp file if not already there */
+                if (!g_file_set_contents (filename, content, -1, &error)) {
+                        g_warning ("  Could not create file:'%s' failed, %s",
+                                   filename,
+                                   error->message);
+                        g_error_free (error);
+                } else {
+                        g_message ("  Last crawl file:'%s' created",
+                                   filename);
+                }
+
+                g_free (content);
+        } else if (!done && already_exists) {
+                /* If NOT done, remove stamp file */
+                g_message ("  Removing last crawl file:'%s'", filename);
+
+                if (g_remove (filename)) {
+                        g_warning ("    Could not remove file:'%s', %m",
+                                   filename);
+                }
+        }
+
+        g_free (filename);
+}
+
+inline static gchar *
+get_need_mtime_check_filename (void)
+{
+       return g_build_filename (g_get_user_cache_dir (),
+                                "tracker",
+                                NEED_MTIME_CHECK_FILENAME,
+                                NULL);
+}
+
+/**
+ * tracker_init_get_need_mtime_check:
+ *
+ * Check if the miner-fs was cleanly shutdown or not.
+ *
+ * Returns: %TRUE if we need to check mtimes for directories against
+ * the database on the next start for the miner-fs, %FALSE otherwise.
+ *
+ * Since: 0.10
+ **/
+gboolean
+tracker_init_get_need_mtime_check (void)
+{
+       gboolean exists;
+       gchar *filename;
+
+       filename = get_need_mtime_check_filename ();
+       exists = g_file_test (filename, G_FILE_TEST_EXISTS);
+       g_free (filename);
+
+       /* Existence of the file means we cleanly shutdown before and
+        * don't need to do the mtime check again on this start.
+        */
+       return !exists;
+}
+
+/**
+ * tracker_init_set_need_mtime_check:
+ * @needed: a #gboolean
+ *
+ * If the next start of miner-fs should perform a full mtime check
+ * against each directory found and those in the database (for
+ * complete synchronisation), then @needed should be #TRUE, otherwise
+ * #FALSE.
+ *
+ * Creates a file in $HOME/.cache/tracker/ if an mtime check is not
+ * needed. The idea behind this is that a check is forced if the file
+ * is not cleaned up properly on shutdown (i.e. due to a crash or any
+ * other uncontrolled shutdown reason).
+ *
+ * Since: 0.10
+ **/
+void
+tracker_init_set_need_mtime_check (gboolean needed)
+{
+       gboolean already_exists;
+       gchar *filename;
+
+       filename = get_need_mtime_check_filename ();
+       already_exists = g_file_test (filename, G_FILE_TEST_EXISTS);
+
+       /* !needed = add file
+        *  needed = remove file
+        */
+       if (!needed && !already_exists) {
+               GError *error = NULL;
+
+               /* Create stamp file if not already there */
+               if (!g_file_set_contents (filename, PACKAGE_VERSION, -1, &error)) {
+                       g_warning ("  Could not create file:'%s' failed, %s",
+                                  filename,
+                                  error->message);
+                       g_error_free (error);
+               } else {
+                       g_message ("  Need mtime check file:'%s' created",
+                                  filename);
+               }
+       } else if (needed && already_exists) {
+               /* Remove stamp file */
+               g_message ("  Removing need mtime check file:'%s'", filename);
+
+               if (g_remove (filename)) {
+                       g_warning ("    Could not remove file:'%s', %m",
+                                  filename);
+               }
+       }
+
+       g_free (filename);
+}
diff --git a/src/libtracker-common/tracker-init.h b/src/libtracker-common/tracker-init.h
new file mode 100644
index 0000000..f58d8ba
--- /dev/null
+++ b/src/libtracker-common/tracker-init.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ */
+
+#ifndef __TRACKER_MINER_INIT_H__
+#define __TRACKER_MINER_INIT_H__
+
+#include "config.h"
+#include <glib.h>
+
+gboolean tracker_init_get_first_index_done (void);
+void     tracker_init_set_first_index_done (gboolean done);
+
+guint64  tracker_init_get_last_crawl_done  (void);
+void     tracker_init_set_last_crawl_done  (gboolean done);
+
+gboolean tracker_init_get_need_mtime_check (void);
+void     tracker_init_set_need_mtime_check (gboolean needed);
+
+#endif /* __TRACKER_MINER_INIT_H__ */
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index ef7d762..0381b51 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -1529,253 +1529,6 @@ tracker_db_manager_has_enough_space  (void)
        return tracker_file_system_has_enough_space (data_dir, TRACKER_DB_MIN_REQUIRED_SPACE, FALSE);
 }
 
-
-inline static gchar *
-get_first_index_filename (void)
-{
-       return g_build_filename (g_get_user_cache_dir (),
-                                "tracker",
-                                FIRST_INDEX_FILENAME,
-                                NULL);
-}
-
-/**
- * tracker_db_manager_get_first_index_done:
- *
- * Check if first full index of files was already done.
- *
- * Returns: %TRUE if a first full index have been done, %FALSE otherwise.
- **/
-gboolean
-tracker_db_manager_get_first_index_done (void)
-{
-       gboolean exists;
-       gchar *filename;
-
-       filename = get_first_index_filename ();
-       exists = g_file_test (filename, G_FILE_TEST_EXISTS);
-       g_free (filename);
-
-       return exists;
-}
-
-/**
- * tracker_db_manager_set_first_index_done:
- *
- * Set the status of the first full index of files. Should be set to
- *  %FALSE if the index was never done or if a reindex is needed. When
- *  the index is completed, should be set to %TRUE.
- **/
-void
-tracker_db_manager_set_first_index_done (gboolean done)
-{
-       gboolean already_exists;
-       gchar *filename;
-
-       filename = get_first_index_filename ();
-       already_exists = g_file_test (filename, G_FILE_TEST_EXISTS);
-
-       if (done && !already_exists) {
-               GError *error = NULL;
-
-               /* If done, create stamp file if not already there */
-               if (!g_file_set_contents (filename, PACKAGE_VERSION, -1, &error)) {
-                       g_warning ("  Could not create file:'%s' failed, %s",
-                                  filename,
-                                  error->message);
-                       g_error_free (error);
-               } else {
-                       g_message ("  First index file:'%s' created",
-                                  filename);
-               }
-       } else if (!done && already_exists) {
-               /* If NOT done, remove stamp file */
-               g_message ("  Removing first index file:'%s'", filename);
-
-               if (g_remove (filename)) {
-                       g_warning ("    Could not remove file:'%s', %s",
-                                  filename,
-                                  g_strerror (errno));
-               }
-       }
-
-       g_free (filename);
-}
-
-inline static gchar *
-get_last_crawl_filename (void)
-{
-       return g_build_filename (g_get_user_cache_dir (),
-                                "tracker",
-                                LAST_CRAWL_FILENAME,
-                                NULL);
-}
-
-/**
- * tracker_db_manager_get_last_crawl_done:
- *
- * Check when last crawl was performed.
- *
- * Returns: time_t() value when last crawl occurred, otherwise 0.
- **/
-guint64
-tracker_db_manager_get_last_crawl_done (void)
-{
-       gchar *filename;
-       gchar *content;
-       guint64 then;
-
-       filename = get_last_crawl_filename ();
-
-       if (!g_file_get_contents (filename, &content, NULL, NULL)) {
-               g_message ("  No previous timestamp, crawling forced");
-               return 0;
-       }
-
-       then = g_ascii_strtoull (content, NULL, 10);
-       g_free (content);
-
-       return then;
-}
-
-/**
- * tracker_db_manager_set_last_crawl_done:
- *
- * Set the status of the first full index of files. Should be set to
- *  %FALSE if the index was never done or if a reindex is needed. When
- *  the index is completed, should be set to %TRUE.
- **/
-void
-tracker_db_manager_set_last_crawl_done (gboolean done)
-{
-       gboolean already_exists;
-       gchar *filename;
-
-       filename = get_last_crawl_filename ();
-       already_exists = g_file_test (filename, G_FILE_TEST_EXISTS);
-
-       if (done && !already_exists) {
-               GError *error = NULL;
-               gchar *content;
-
-               content = g_strdup_printf ("%" G_GUINT64_FORMAT, (guint64) time (NULL));
-
-               /* If done, create stamp file if not already there */
-               if (!g_file_set_contents (filename, content, -1, &error)) {
-                       g_warning ("  Could not create file:'%s' failed, %s",
-                                  filename,
-                                  error->message);
-                       g_error_free (error);
-               } else {
-                       g_message ("  Last crawl file:'%s' created",
-                                  filename);
-               }
-
-               g_free (content);
-       } else if (!done && already_exists) {
-               /* If NOT done, remove stamp file */
-               g_message ("  Removing last crawl file:'%s'", filename);
-
-               if (g_remove (filename)) {
-                       g_warning ("    Could not remove file:'%s', %s",
-                                  filename,
-                                  g_strerror (errno));
-               }
-       }
-
-       g_free (filename);
-}
-
-inline static gchar *
-get_need_mtime_check_filename (void)
-{
-       return g_build_filename (g_get_user_cache_dir (),
-                                "tracker",
-                                NEED_MTIME_CHECK_FILENAME,
-                                NULL);
-}
-
-/**
- * tracker_db_manager_get_need_mtime_check:
- *
- * Check if the miner-fs was cleanly shutdown or not.
- *
- * Returns: %TRUE if we need to check mtimes for directories against
- * the database on the next start for the miner-fs, %FALSE otherwise.
- *
- * Since: 0.10
- **/
-gboolean
-tracker_db_manager_get_need_mtime_check (void)
-{
-       gboolean exists;
-       gchar *filename;
-
-       filename = get_need_mtime_check_filename ();
-       exists = g_file_test (filename, G_FILE_TEST_EXISTS);
-       g_free (filename);
-
-       /* Existence of the file means we cleanly shutdown before and
-        * don't need to do the mtime check again on this start.
-        */
-       return !exists;
-}
-
-/**
- * tracker_db_manager_set_need_mtime_check:
- * @needed: a #gboolean
- *
- * If the next start of miner-fs should perform a full mtime check
- * against each directory found and those in the database (for
- * complete synchronisation), then @needed should be #TRUE, otherwise
- * #FALSE.
- *
- * Creates a file in $HOME/.cache/tracker/ if an mtime check is not
- * needed. The idea behind this is that a check is forced if the file
- * is not cleaned up properly on shutdown (i.e. due to a crash or any
- * other uncontrolled shutdown reason).
- *
- * Since: 0.10
- **/
-void
-tracker_db_manager_set_need_mtime_check (gboolean needed)
-{
-       gboolean already_exists;
-       gchar *filename;
-
-       filename = get_need_mtime_check_filename ();
-       already_exists = g_file_test (filename, G_FILE_TEST_EXISTS);
-
-       /* !needed = add file
-        *  needed = remove file
-        */
-       if (!needed && !already_exists) {
-               GError *error = NULL;
-
-               /* Create stamp file if not already there */
-               if (!g_file_set_contents (filename, PACKAGE_VERSION, -1, &error)) {
-                       g_warning ("  Could not create file:'%s' failed, %s",
-                                  filename,
-                                  error->message);
-                       g_error_free (error);
-               } else {
-                       g_message ("  Need mtime check file:'%s' created",
-                                  filename);
-               }
-       } else if (needed && already_exists) {
-               /* Remove stamp file */
-               g_message ("  Removing need mtime check file:'%s'", filename);
-
-               if (g_remove (filename)) {
-                       g_warning ("    Could not remove file:'%s', %s",
-                                  filename,
-                                  g_strerror (errno));
-               }
-       }
-
-       g_free (filename);
-}
-
 void
 tracker_db_manager_lock (void)
 {
diff --git a/src/libtracker-data/tracker-db-manager.h b/src/libtracker-data/tracker-db-manager.h
index c88c7b4..6a8f79a 100644
--- a/src/libtracker-data/tracker-db-manager.h
+++ b/src/libtracker-data/tracker-db-manager.h
@@ -79,14 +79,6 @@ TrackerDBManagerFlags
                     tracker_db_manager_get_flags              (guint *select_cache_size,
                                                                guint *update_cache_size);
 
-gboolean            tracker_db_manager_get_first_index_done   (void);
-guint64             tracker_db_manager_get_last_crawl_done    (void);
-gboolean            tracker_db_manager_get_need_mtime_check   (void);
-
-void                tracker_db_manager_set_first_index_done   (gboolean done);
-void                tracker_db_manager_set_last_crawl_done    (gboolean done);
-void                tracker_db_manager_set_need_mtime_check   (gboolean needed);
-
 gboolean            tracker_db_manager_locale_changed         (void);
 void                tracker_db_manager_set_current_locale     (void);
 
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index f40ff5c..15ce9dc 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -35,8 +35,6 @@
 #include <libtracker-sparql/tracker-sparql.h>
 #include <libtracker-miner/tracker-miner.h>
 
-#include <libtracker-data/tracker-db-manager.h>
-
 #include "tracker-config.h"
 #include "tracker-miner-files.h"
 #include "tracker-miner-files-index.h"
@@ -220,7 +218,7 @@ should_crawl (TrackerConfig *config,
        } else {
                guint64 then, now;
 
-               then = tracker_db_manager_get_last_crawl_done ();
+               then = tracker_init_get_last_crawl_done ();
 
                if (then < 1) {
                        return TRUE;
@@ -329,7 +327,7 @@ miner_finished_cb (TrackerMinerFS *fs,
 
        if (TRACKER_IS_MINER_FILES (fs) &&
            tracker_miner_fs_get_initial_crawling (fs)) {
-               tracker_db_manager_set_last_crawl_done (TRUE);
+               tracker_init_set_last_crawl_done (TRUE);
        }
 
        miner_handle_next ();
@@ -738,7 +736,7 @@ main (gint argc, gchar *argv[])
 
        /* This makes sure we don't steal all the system's resources */
        initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
-                                           tracker_db_manager_get_first_index_done () == FALSE);
+                                           tracker_init_get_first_index_done () == FALSE);
 
        main_loop = g_main_loop_new (NULL, FALSE);
 
@@ -797,7 +795,7 @@ main (gint argc, gchar *argv[])
        if (force_mtime_checking) {
                do_mtime_checking = TRUE;
        } else {
-               do_mtime_checking = tracker_db_manager_get_need_mtime_check ();
+               do_mtime_checking = tracker_init_get_need_mtime_check ();
        }
 
        g_message ("  %s %s",
@@ -808,7 +806,7 @@ main (gint argc, gchar *argv[])
         * event of a crash, this is changed back on shutdown if
         * everything appears to be fine.
         */
-       tracker_db_manager_set_need_mtime_check (TRUE);
+       tracker_init_set_need_mtime_check (TRUE);
 
        /* Configure files miner */
        tracker_miner_fs_set_initial_crawling (TRACKER_MINER_FS (miner_files), do_crawling);
@@ -832,7 +830,7 @@ main (gint argc, gchar *argv[])
 
        if (miners_timeout_id == 0 &&
            !miner_needs_check (miner_files, store_available)) {
-               tracker_db_manager_set_need_mtime_check (FALSE);
+               tracker_init_set_need_mtime_check (FALSE);
        }
 
        g_main_loop_unref (main_loop);
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index e0cd48d..71aa4ca 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -38,8 +38,6 @@
 #include <libtracker-sparql/tracker-ontologies.h>
 #include <libtracker-extract/tracker-extract.h>
 
-#include <libtracker-data/tracker-db-manager.h>
-
 #include "tracker-power.h"
 #include "tracker-miner-files.h"
 #include "tracker-config.h"
@@ -1336,7 +1334,7 @@ check_battery_status (TrackerMinerFiles *mf)
                        if (!tracker_config_get_index_on_battery_first_time (mf->private->config)) {
                                g_message ("Running on battery, but not enabled, pausing");
                                should_pause = TRUE;
-                       } else if (tracker_db_manager_get_first_index_done ()) {
+                       } else if (tracker_init_get_first_index_done ()) {
                                g_message ("Running on battery and first-time index "
                                           "already done, pausing");
                                should_pause = TRUE;
@@ -1407,8 +1405,8 @@ miner_finished_cb (TrackerMinerFS *fs,
        TrackerMinerFiles *mf = TRACKER_MINER_FILES (fs);
 
        /* Create stamp file if not already there */
-       if (!tracker_db_manager_get_first_index_done ()) {
-               tracker_db_manager_set_first_index_done (TRUE);
+       if (!tracker_init_get_first_index_done ()) {
+               tracker_init_set_first_index_done (TRUE);
        }
 
        /* And remove the signal handler so that it's not
@@ -2492,7 +2490,7 @@ miner_files_finished (TrackerMinerFS *fs,
                       gint            files_found,
                       gint            files_ignored)
 {
-       tracker_db_manager_set_last_crawl_done (TRUE);
+       tracker_init_set_last_crawl_done (TRUE);
 }
 
 TrackerMiner *
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index d8e0f5f..d923dcc 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -44,8 +44,6 @@
 
 #include <libtracker-common/tracker-common.h>
 
-#include <libtracker-data/tracker-db-manager.h>
-
 #include "tracker-config.h"
 #include "tracker-main.h"
 #include "tracker-extract.h"
@@ -275,7 +273,7 @@ run_standalone (TrackerConfig *config)
 
        /* This makes sure we don't steal all the system's resources */
        initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
-                                           tracker_db_manager_get_first_index_done () == FALSE);
+                                           tracker_init_get_first_index_done () == FALSE);
 
        file = g_file_new_for_commandline_arg (filename);
        uri = g_file_get_uri (file);
@@ -372,7 +370,7 @@ main (int argc, char *argv[])
 
        /* This makes sure we don't steal all the system's resources */
        initialize_priority_and_scheduling (tracker_config_get_sched_idle (config),
-                                           tracker_db_manager_get_first_index_done () == FALSE);
+                                           tracker_init_get_first_index_done () == FALSE);
 
        extract = tracker_extract_new (TRUE, force_module);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]