tracker r1570 - in branches/indexer-split: . src/libtracker-common src/trackerd
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1570 - in branches/indexer-split: . src/libtracker-common src/trackerd
- Date: Tue, 3 Jun 2008 10:43:52 +0000 (UTC)
Author: mr
Date: Tue Jun 3 10:43:52 2008
New Revision: 1570
URL: http://svn.gnome.org/viewvc/tracker?rev=1570&view=rev
Log:
* src/libtracker-common/tracker-file-utils.c:
* src/libtracker-common/tracker-os-dependant-unix.c:
* src/libtracker-common/tracker-os-dependant-win.c:
* src/libtracker-common/tracker-os-dependant.h:
* src/trackerd/tracker-process-files.c: Removed
tracker_check_uri(), it is hardly used and it is only a pointer
check.
* src/trackerd/tracker-db.c: Refactored the code in places.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-common/tracker-file-utils.c
branches/indexer-split/src/libtracker-common/tracker-os-dependant-unix.c
branches/indexer-split/src/libtracker-common/tracker-os-dependant-win.c
branches/indexer-split/src/libtracker-common/tracker-os-dependant.h
branches/indexer-split/src/trackerd/tracker-db.c
branches/indexer-split/src/trackerd/tracker-db.h
branches/indexer-split/src/trackerd/tracker-process-files.c
Modified: branches/indexer-split/src/libtracker-common/tracker-file-utils.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-file-utils.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-file-utils.c Tue Jun 3 10:43:52 2008
@@ -207,7 +207,7 @@
/* g_file_test (file,G_FILE_TEST_EXISTS) uses the access ()
* system call and so needs locale filenames.
*/
- is_valid &= tracker_check_uri (uri);
+ is_valid &= uri != NULL;
is_valid &= g_file_test (str,
G_FILE_TEST_IS_REGULAR |
G_FILE_TEST_IS_DIR |
Modified: branches/indexer-split/src/libtracker-common/tracker-os-dependant-unix.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-os-dependant-unix.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-os-dependant-unix.c Tue Jun 3 10:43:52 2008
@@ -32,12 +32,6 @@
#define MAX_MEM_AMD64 512
gboolean
-tracker_check_uri (const gchar *uri)
-{
- return uri && uri[0] == G_DIR_SEPARATOR;
-}
-
-gboolean
tracker_spawn (gchar **argv,
gint timeout,
gchar **tmp_stdout,
Modified: branches/indexer-split/src/libtracker-common/tracker-os-dependant-win.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-os-dependant-win.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-os-dependant-win.c Tue Jun 3 10:43:52 2008
@@ -25,12 +25,6 @@
#include "tracker-os-dependant.h"
gboolean
-tracker_check_uri (const gchar *uri)
-{
- return uri != NULL;
-}
-
-gboolean
tracker_spawn (gchar **argv,
gint timeout,
gchar **tmp_stdout,
Modified: branches/indexer-split/src/libtracker-common/tracker-os-dependant.h
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-os-dependant.h (original)
+++ branches/indexer-split/src/libtracker-common/tracker-os-dependant.h Tue Jun 3 10:43:52 2008
@@ -25,7 +25,6 @@
#include <glib.h>
#include <glib/gstdio.h>
-gboolean tracker_check_uri (const gchar *uri);
gboolean tracker_spawn (gchar **argv,
gint timeout,
gchar **tmp_stdout,
Modified: branches/indexer-split/src/trackerd/tracker-db.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.c (original)
+++ branches/indexer-split/src/trackerd/tracker-db.c Tue Jun 3 10:43:52 2008
@@ -29,14 +29,17 @@
#include "tracker-process-files.h"
gboolean
-tracker_db_is_file_up_to_date (DBConnection *db_con, const char *uri, guint32 *id)
+tracker_db_is_file_up_to_date (DBConnection *db_con,
+ const gchar *uri,
+ guint32 *id)
{
TrackerDBResultSet *result_set;
- char *path, *name;
- gint32 index_time;
+ gchar *path, *name;
+ gint32 index_time;
- g_return_val_if_fail (db_con, FALSE);
- g_return_val_if_fail (tracker_check_uri (uri), FALSE);
+ g_return_val_if_fail (db_con != NULL, FALSE);
+ g_return_val_if_fail (uri != NULL, FALSE);
+ g_return_val_if_fail (id != NULL, FALSE);
if (uri[0] == G_DIR_SEPARATOR) {
name = g_path_get_basename (uri);
@@ -65,7 +68,7 @@
return FALSE;
}
- if (index_time < (gint32) tracker_file_get_mtime (uri)) {
+ if (index_time < tracker_file_get_mtime (uri)) {
return FALSE;
}
@@ -73,14 +76,15 @@
}
guint32
-tracker_db_get_file_id (DBConnection *db_con, const char *uri)
+tracker_db_get_file_id (DBConnection *db_con,
+ const gchar *uri)
{
TrackerDBResultSet *result_set;
char *path, *name;
guint32 id;
- g_return_val_if_fail (db_con, 0);
- g_return_val_if_fail (uri, 0);
+ g_return_val_if_fail (db_con != NULL, 0);
+ g_return_val_if_fail (uri != NULL, 0);
if (uri[0] == G_DIR_SEPARATOR) {
name = g_path_get_basename (uri);
@@ -106,13 +110,14 @@
}
TrackerDBFileInfo *
-tracker_db_get_file_info (DBConnection *db_con, TrackerDBFileInfo *info)
+tracker_db_get_file_info (DBConnection *db_con,
+ TrackerDBFileInfo *info)
{
TrackerDBResultSet *result_set;
- gchar *path, *name;
+ gchar *path, *name;
- g_return_val_if_fail (db_con, info);
- g_return_val_if_fail (info, info);
+ g_return_val_if_fail (db_con != NULL, info);
+ g_return_val_if_fail (info != NULL, info);
if (!tracker_process_files_is_file_info_valid (info)) {
return NULL;
@@ -127,7 +132,7 @@
g_free (path);
if (result_set) {
- gint id, indextime, service_type_id;
+ gint id, indextime, service_type_id;
gboolean is_directory;
tracker_db_result_set_get (result_set,
@@ -152,22 +157,22 @@
return info;
}
-char **
-tracker_db_get_files_in_folder (DBConnection *db_con, const char *folder_uri)
+gchar **
+tracker_db_get_files_in_folder (DBConnection *db_con,
+ const gchar *uri)
{
TrackerDBResultSet *result_set;
- GPtrArray *array;
+ GPtrArray *array;
- g_return_val_if_fail (db_con, NULL);
- g_return_val_if_fail (folder_uri, NULL);
- g_return_val_if_fail (folder_uri[0] != '\0', NULL);
+ g_return_val_if_fail (db_con != NULL, NULL);
+ g_return_val_if_fail (uri != NULL, NULL);
- result_set = tracker_exec_proc (db_con, "SelectFileChild", folder_uri, NULL);
+ result_set = tracker_exec_proc (db_con, "SelectFileChild", uri, NULL);
array = g_ptr_array_new ();
if (result_set) {
- gboolean valid = TRUE;
- gchar *name, *prefix;
+ gchar *name, *prefix;
+ gboolean valid = TRUE;
while (valid) {
tracker_db_result_set_get (result_set,
@@ -187,15 +192,17 @@
g_ptr_array_add (array, NULL);
- return (gchar **) g_ptr_array_free (array, FALSE);
+ return (gchar**) g_ptr_array_free (array, FALSE);
}
void
tracker_db_init (void)
{
+ /* Nothing to do? - maybe create connections? */
}
void
tracker_db_shutdown (void)
{
+ /* Nothing to do? */
}
Modified: branches/indexer-split/src/trackerd/tracker-db.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.h (original)
+++ branches/indexer-split/src/trackerd/tracker-db.h Tue Jun 3 10:43:52 2008
@@ -29,18 +29,18 @@
G_BEGIN_DECLS
-void tracker_db_init (void);
-void tracker_db_shutdown (void);
-gboolean tracker_db_is_file_up_to_date (DBConnection *db_con,
- const gchar *uri,
- guint32 *id);
-TrackerDBFileInfo *tracker_db_get_file_info (DBConnection *db_con,
- TrackerDBFileInfo *info);
-gchar * tracker_db_get_id (DBConnection *db_con,
- const gchar *service,
- const gchar *uri);
-gchar ** tracker_db_get_files_in_folder (DBConnection *db_con,
- const gchar *folder_uri);
+void tracker_db_init (void);
+void tracker_db_shutdown (void);
+gboolean tracker_db_is_file_up_to_date (DBConnection *db_con,
+ const gchar *uri,
+ guint32 *id);
+TrackerDBFileInfo *tracker_db_get_file_info (DBConnection *db_con,
+ TrackerDBFileInfo *info);
+gchar * tracker_db_get_id (DBConnection *db_con,
+ const gchar *service,
+ const gchar *uri);
+gchar ** tracker_db_get_files_in_folder (DBConnection *db_con,
+ const gchar *folder_uri);
G_END_DECLS
Modified: branches/indexer-split/src/trackerd/tracker-process-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-process-files.c (original)
+++ branches/indexer-split/src/trackerd/tracker-process-files.c Tue Jun 3 10:43:52 2008
@@ -281,8 +281,8 @@
process_schedule_file_check_foreach (const gchar *uri,
DBConnection *db_con)
{
- g_return_if_fail (tracker_check_uri (uri));
- g_return_if_fail (db_con);
+ g_return_if_fail (uri != NULL);
+ g_return_if_fail (db_con != NULL);
/* Keep mainloop responsive */
process_my_yield ();
@@ -331,8 +331,8 @@
{
GSList *files;
- g_return_if_fail (db_con);
- g_return_if_fail (tracker_check_uri (uri));
+ g_return_if_fail (db_con != NULL);
+ g_return_if_fail (uri != NULL);
g_return_if_fail (tracker_file_is_directory (uri));
/* Keep mainloop responsive */
@@ -453,7 +453,7 @@
{
GSList *files;
- g_return_if_fail (tracker_check_uri (uri));
+ g_return_if_fail (uri != NULL);
g_return_if_fail (tracker_file_is_directory (uri));
files = process_get_files (uri, FALSE, TRUE, NULL);
@@ -917,10 +917,6 @@
g_return_val_if_fail (TRACKER_IS_CONFIG (config), FALSE);
g_return_val_if_fail (uri != NULL, FALSE);
- if (!tracker_check_uri (uri)) {
- return FALSE;
- }
-
if (process_is_in_path (uri, g_get_tmp_dir ())) {
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]