[tracker] libtracker-common, libtracker-extract: Don't confuse uri with path



commit c5d0bbd8122516dc97b496b494c46a3ebf0b1eb9
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Feb 23 18:19:17 2011 +0100

    libtracker-common, libtracker-extract: Don't confuse uri with path

 src/libtracker-common/tracker-file-utils.c |    8 ++++----
 src/libtracker-common/tracker-file-utils.h |    2 +-
 src/libtracker-extract/tracker-guarantee.c |    5 +----
 3 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index f6a6c1b..550936c 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -51,7 +51,7 @@
 static GHashTable *file_locks = NULL;
 
 FILE *
-tracker_file_open (const gchar *uri,
+tracker_file_open (const gchar *path,
                    const gchar *how,
                    gboolean     sequential)
 {
@@ -59,16 +59,16 @@ tracker_file_open (const gchar *uri,
 	gboolean  readonly;
 	int       flags;
 
-	g_return_val_if_fail (uri != NULL, NULL);
+	g_return_val_if_fail (path != NULL, NULL);
 	g_return_val_if_fail (how != NULL, NULL);
 
-	file = fopen (uri, how);
+	file = fopen (path, how);
 	if (!file) {
 		return NULL;
 	}
 
 	/* Are we opening for readonly? */
-	readonly = !strstr (uri, "r+") && strchr (uri, 'r');
+	readonly = !strstr (path, "r+") && strchr (path, 'r');
 
 	if (readonly) {
 		int fd;
diff --git a/src/libtracker-common/tracker-file-utils.h b/src/libtracker-common/tracker-file-utils.h
index 4a308df..48949b9 100644
--- a/src/libtracker-common/tracker-file-utils.h
+++ b/src/libtracker-common/tracker-file-utils.h
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 #endif
 
 /* File utils */
-FILE*    tracker_file_open          (const gchar  *uri,
+FILE*    tracker_file_open          (const gchar  *path,
                                      const gchar  *how,
                                      gboolean      sequential);
 void     tracker_file_close         (FILE         *file,
diff --git a/src/libtracker-extract/tracker-guarantee.c b/src/libtracker-extract/tracker-guarantee.c
index e757395..5c61520 100644
--- a/src/libtracker-extract/tracker-guarantee.c
+++ b/src/libtracker-extract/tracker-guarantee.c
@@ -52,13 +52,10 @@ get_title_from_file (const gchar *uri)
 static gchar *
 get_date_from_file_mtime (const gchar *uri)
 {
-	gchar *filename;
 	gchar *date;
 	guint64 mtime;
 
-	filename = g_filename_from_uri (uri, NULL, NULL);
-	mtime = tracker_file_get_mtime (filename);
-	g_free (filename);
+	mtime = tracker_file_get_mtime_uri (uri);
 
 	date = tracker_date_to_string ((time_t) mtime);
 



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