[tracker/rss-enclosures] libtracker-data: Remove unused Options table



commit fb13bffb75b5a260aabe8e9ff4e670c218ef3997
Author: Jürg Billeter <j bitron ch>
Date:   Fri Aug 13 17:27:28 2010 +0200

    libtracker-data: Remove unused Options table

 configure.ac                               |    1 -
 data/Makefile.am                           |    2 +-
 data/db/Makefile.am                        |    8 ---
 data/db/sqlite-tracker.sql                 |    6 --
 src/libtracker-data/tracker-data-manager.c |   75 ----------------------------
 src/libtracker-data/tracker-data-manager.h |    3 -
 src/libtracker-data/tracker-db-manager.c   |   61 ----------------------
 7 files changed, 1 insertions(+), 155 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 455e501..206ae8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1840,7 +1840,6 @@ AM_CONDITIONAL(OLD_DATA_REMOVE_ALL, test -n "$old_data_message")
 ##################################################################
 
 AC_CONFIG_FILES([
-	data/db/Makefile
 	data/dbus/Makefile
 	data/icons/16x16/Makefile
 	data/icons/22x22/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index 734d1f2..cbc9aa2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,6 +1,6 @@
 include $(top_srcdir)/Makefile.decl
 
-SUBDIRS = db dbus languages icons ontologies miners
+SUBDIRS = dbus languages icons ontologies miners
 
 # First we fix the VERSION and libexecdir in the desktop files
 tracker-status-icon.desktop.in: tracker-status-icon.desktop.in.in
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 232e55b..53c47a1 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -3075,78 +3075,3 @@ tracker_data_manager_shutdown (void)
 
 	initialized = FALSE;
 }
-
-gint64
-tracker_data_manager_get_db_option_int64 (const gchar *option)
-{
-	TrackerDBInterface *iface;
-	TrackerDBStatement *stmt;
-	TrackerDBResultSet *result_set = NULL;
-	gchar              *str;
-	gint                value = 0;
-	GError             *error = NULL;
-
-	g_return_val_if_fail (option != NULL, 0);
-
-	iface = tracker_db_manager_get_db_interface ();
-
-	stmt = tracker_db_interface_create_statement (iface, &error, "SELECT OptionValue FROM Options WHERE OptionKey = ?");
-
-	if (stmt) {
-		tracker_db_statement_bind_text (stmt, 0, option);
-		result_set = tracker_db_statement_execute (stmt, &error);
-		g_object_unref (stmt);
-	}
-
-	if (result_set) {
-		tracker_db_result_set_get (result_set, 0, &str, -1);
-
-		if (str) {
-			value = g_ascii_strtoull (str, NULL, 10);
-			g_free (str);
-		}
-
-		g_object_unref (result_set);
-	}
-
-	if (error) {
-		g_warning ("%s", error->message);
-		g_error_free (error);
-		return -1;
-	}
-
-	return value;
-}
-
-void
-tracker_data_manager_set_db_option_int64 (const gchar *option,
-                                          gint64       value)
-{
-	TrackerDBInterface *iface;
-	TrackerDBStatement *stmt;
-	gchar              *str;
-	GError             *error = NULL;
-
-	g_return_if_fail (option != NULL);
-
-	iface = tracker_db_manager_get_db_interface ();
-
-	stmt = tracker_db_interface_create_statement (iface, &error, "REPLACE INTO Options (OptionKey, OptionValue) VALUES (?,?)");
-
-	if (stmt) {
-		tracker_db_statement_bind_text (stmt, 0, option);
-
-		str = g_strdup_printf ("%"G_GINT64_FORMAT, value);
-		tracker_db_statement_bind_text (stmt, 1, str);
-		g_free (str);
-
-		tracker_db_statement_execute (stmt, &error);
-		g_object_unref (stmt);
-	}
-
-	if (error) {
-		g_warning ("%s", error->message);
-		g_error_free (error);
-		return;
-	}
-}
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 7383cf4..b5ba1fc 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -47,9 +47,6 @@ gboolean tracker_data_manager_init                   (TrackerDBManagerFlags  fla
                                                       const gchar           *busy_status);
 void     tracker_data_manager_shutdown               (void);
 
-gint64   tracker_data_manager_get_db_option_int64    (const gchar           *option);
-void     tracker_data_manager_set_db_option_int64    (const gchar           *option,
-                                                      gint64                 value);
 void     tracker_data_ontology_load_statement        (const gchar           *ontology_file,
                                                       gint                   subject_id,
                                                       const gchar           *subject,
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 0f8855e..62bdc0c 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -179,58 +179,6 @@ location_to_directory (TrackerDBLocation location)
 	};
 }
 
-static void
-load_sql_file (TrackerDBInterface *iface,
-               const gchar        *file,
-               const gchar        *delimiter)
-{
-	gchar *path, *content, **queries;
-	gint   count;
-	gint   i;
-
-	path = g_build_filename (sql_dir, file, NULL);
-
-	if (!delimiter) {
-		delimiter = ";";
-	}
-
-	if (!g_file_get_contents (path, &content, NULL, NULL)) {
-		g_critical ("Cannot read SQL file:'%s', please reinstall tracker"
-		            " or check read permissions on the file if it exists", path);
-		g_assert_not_reached ();
-	}
-
-	queries = g_strsplit (content, delimiter, -1);
-
-	for (i = 0, count = 0; queries[i]; i++) {
-		GError *error = NULL;
-		gchar  *sql;
-
-		/* Skip white space, including control characters */
-		for (sql = queries[i]; sql && g_ascii_isspace (sql[0]); sql++);
-
-		if (!sql || sql[0] == '\0') {
-			continue;
-		}
-
-		tracker_db_interface_execute_query (iface, &error, "%s", sql);
-
-		if (error) {
-			g_warning ("Error loading query:'%s' #%d, %s", file, i, error->message);
-			g_error_free (error);
-			continue;
-		}
-
-		count++;
-	}
-
-	g_message ("  Loaded SQL file:'%s' (%d queries)", file, count);
-
-	g_strfreev (queries);
-	g_free (content);
-	g_free (path);
-}
-
 static gboolean
 db_exec_no_reply (TrackerDBInterface *iface,
                   const gchar        *query,
@@ -350,15 +298,6 @@ db_interface_get_metadata (void)
 
 	iface = db_interface_get (TRACKER_DB_METADATA, &create);
 
-	if (create) {
-		tracker_db_interface_start_transaction (iface);
-
-		/* Create tables */
-		load_sql_file (iface, "sqlite-tracker.sql", NULL);
-
-		tracker_db_interface_end_db_transaction (iface);
-	}
-
 	return iface;
 }
 



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