tracker r2514 - in branches/uri: . src/tracker-search-tool
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2514 - in branches/uri: . src/tracker-search-tool
- Date: Tue, 18 Nov 2008 11:03:18 +0000 (UTC)
Author: juergbi
Date: Tue Nov 18 11:03:18 2008
New Revision: 2514
URL: http://svn.gnome.org/viewvc/tracker?rev=2514&view=rev
Log:
2008-11-18 JÃrg Billeter <j bitron ch>
* src/tracker-search-tool/tracker-search-tool-callbacks.c:
* src/tracker-search-tool/tracker-search-tool.c:
Update tracker-search-tool to work with URIs2008-11-18 JÃrg Billeter <j bitron ch>
* src/tracker-search-tool/tracker-search-tool-callbacks.c:
* src/tracker-search-tool/tracker-search-tool.c:
Update tracker-search-tool to work with URIs
Modified:
branches/uri/ChangeLog
branches/uri/src/tracker-search-tool/tracker-search-tool-callbacks.c
branches/uri/src/tracker-search-tool/tracker-search-tool.c
Modified: branches/uri/src/tracker-search-tool/tracker-search-tool-callbacks.c
==============================================================================
--- branches/uri/src/tracker-search-tool/tracker-search-tool-callbacks.c (original)
+++ branches/uri/src/tracker-search-tool/tracker-search-tool-callbacks.c Tue Nov 18 11:03:18 2008
@@ -634,7 +634,7 @@
} else {
GFile * file;
- file = g_file_new_for_path (uri);
+ file = g_file_new_for_uri (uri);
if (!g_file_query_exists (file, NULL)) {
gtk_tree_selection_unselect_iter (GTK_TREE_SELECTION (gsearch->search_results_selection),
Modified: branches/uri/src/tracker-search-tool/tracker-search-tool.c
==============================================================================
--- branches/uri/src/tracker-search-tool/tracker-search-tool.c (original)
+++ branches/uri/src/tracker-search-tool/tracker-search-tool.c Tue Nov 18 11:03:18 2008
@@ -500,7 +500,7 @@
}
static void
-add_file_to_search_results (const gchar * file_path,
+add_file_to_search_results (const gchar * file_uri,
ServiceType service_type,
const gchar * mime,
GtkListStore * store,
@@ -508,7 +508,7 @@
GSearchWindow * gsearch)
{
GdkPixbuf * pixbuf;
- GFile * file;
+ GFile *file, *parent_file;
GFileInfo * file_info;
GError * error = NULL;
@@ -516,12 +516,12 @@
gchar * base_name;
gchar * dir_name;
- file = g_file_new_for_path (file_path);
+ file = g_file_new_for_uri (file_uri);
file_info = g_file_query_info (file, "standard::*,access::*",
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
NULL, &error);
if (!file_info) {
- g_warning ("Error querying info for file %s: %s", file_path,
+ g_warning ("Error querying info for file %s: %s", file_uri,
error->message);
g_error_free (error);
g_object_unref (file);
@@ -538,13 +538,14 @@
g_return_if_fail (description != NULL);
- base_name = g_path_get_basename (file_path);
- dir_name = g_path_get_dirname (file_path);
+ base_name = g_file_get_basename (file);
+ parent_file = g_file_get_parent (file);
+ dir_name = g_file_get_path (parent_file);
gtk_list_store_append (GTK_LIST_STORE (store), iter);
gtk_list_store_set (GTK_LIST_STORE (store), iter,
COLUMN_ICON, pixbuf,
- COLUMN_URI, file_path,
+ COLUMN_URI, file_uri,
COLUMN_NAME, base_name,
COLUMN_PATH, dir_name,
COLUMN_MIME, description,
@@ -569,6 +570,7 @@
}
g_object_unref (file);
+ g_object_unref (parent_file);
g_object_unref (file_info);
g_free (base_name);
g_free (dir_name);
@@ -584,9 +586,13 @@
GtkTreeIter * iter,
GSearchWindow * gsearch)
{
- GdkPixbuf * pixbuf = NULL;
+ GFile *file;
+ GdkPixbuf *pixbuf = NULL;
- if (!g_file_test (uri, G_FILE_TEST_EXISTS)) {
+ file = g_file_new_for_uri (uri);
+
+ if (!g_file_query_exists (file, NULL)) {
+ g_object_unref (file);
return;
}
@@ -621,6 +627,8 @@
COLUMN_EXEC, exec,
COLUMN_NO_FILES_FOUND, FALSE,
-1);
+
+ g_object_unref (file);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]