[tracker/binary-log-2: 10/63] libtracker-db: Made it possible to pass the filename of the journal to the internal API
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/binary-log-2: 10/63] libtracker-db: Made it possible to pass the filename of the journal to the internal API
- Date: Fri, 8 Jan 2010 09:43:16 +0000 (UTC)
commit d90e65b489f74a7a4779ca3c18f29a02969839bd
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Dec 30 10:32:04 2009 +0100
libtracker-db: Made it possible to pass the filename of the journal to the internal API
src/libtracker-data/tracker-data-manager.c | 3 ++-
src/libtracker-db/tracker-db-journal.c | 8 ++++++--
src/libtracker-db/tracker-db-journal.h | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 191b4b9..24716cb 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -36,6 +36,7 @@
#include <libtracker-db/tracker-db-interface-sqlite.h>
#include <libtracker-db/tracker-db-manager.h>
+#include <libtracker-db/tracker-db-journal.h>
#include "tracker-data-manager.h"
#include "tracker-data-update.h"
@@ -815,7 +816,7 @@ tracker_data_manager_init (TrackerDBManagerFlags flags,
iface = tracker_db_manager_get_db_interface ();
- tracker_db_journal_open ();
+ tracker_db_journal_open (NULL);
if (is_first_time_index) {
TrackerClass **classes;
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index eae0f2f..ba03c45 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -105,11 +105,15 @@ cur_block_maybe_expand (guint len)
}
void
-tracker_db_journal_open (void)
+tracker_db_journal_open (const gchar *filen)
{
struct stat st;
- get_filename ();
+ if (!filen) {
+ get_filename ();
+ } else {
+ filename = g_strdup (filen);
+ }
journal = fopen (filename, "a");
diff --git a/src/libtracker-db/tracker-db-journal.h b/src/libtracker-db/tracker-db-journal.h
index 0356fb4..b28bd08 100644
--- a/src/libtracker-db/tracker-db-journal.h
+++ b/src/libtracker-db/tracker-db-journal.h
@@ -28,7 +28,7 @@
G_BEGIN_DECLS
const gchar* tracker_db_journal_filename (void);
-void tracker_db_journal_open (void);
+void tracker_db_journal_open (const gchar *filen);
void tracker_db_journal_start_transaction (void);
void tracker_db_journal_append_delete_statement (guint32 s_code,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]