tracker r2515 - in branches/uri: . src/libtracker-data
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2515 - in branches/uri: . src/libtracker-data
- Date: Tue, 18 Nov 2008 11:21:40 +0000 (UTC)
Author: juergbi
Date: Tue Nov 18 11:21:40 2008
New Revision: 2515
URL: http://svn.gnome.org/viewvc/tracker?rev=2515&view=rev
Log:
2008-11-18 JÃrg Billeter <j bitron ch>
* src/libtracker-data/tracker-data-update.c:
Use GFile for file tests based on URIs in
tracker_data_update_create_service
Modified:
branches/uri/ChangeLog
branches/uri/src/libtracker-data/tracker-data-update.c
Modified: branches/uri/src/libtracker-data/tracker-data-update.c
==============================================================================
--- branches/uri/src/libtracker-data/tracker-data-update.c (original)
+++ branches/uri/src/libtracker-data/tracker-data-update.c Tue Nov 18 11:21:40 2008
@@ -150,6 +150,8 @@
TrackerDataMetadata *metadata)
{
TrackerDBInterface *iface;
+ GFile *file;
+ GFileInfo *file_info;
gchar *id_str, *service_type_id_str, *basename;
gboolean is_dir, is_symlink, enabled;
@@ -163,10 +165,20 @@
id_str = tracker_guint32_to_string (service_id);
service_type_id_str = tracker_gint_to_string (tracker_service_get_id (service));
- basename = g_path_get_basename (uri);
+ file = g_file_new_for_uri (uri);
+ basename = g_file_get_basename (file);
- is_dir = g_file_test (uri, G_FILE_TEST_IS_DIR);
- is_symlink = g_file_test (uri, G_FILE_TEST_IS_SYMLINK);
+ file_info = g_file_query_info (file, "standard::*", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, NULL);
+ if (file_info) {
+ is_dir = (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY);
+ is_symlink = g_file_info_get_is_symlink (file_info);
+
+ g_object_unref (file_info);
+ } else {
+ /* not a file */
+ is_dir = FALSE;
+ is_symlink = FALSE;
+ }
/* FIXME: do not hardcode arguments */
tracker_db_interface_execute_procedure (iface, NULL, "CreateService",
@@ -196,6 +208,7 @@
g_free (id_str);
g_free (service_type_id_str);
g_free (basename);
+ g_object_unref (file);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]