[gnome-color-manager] trivial: Support URI's in gcm_utils_is_icc_profile() to support dragging and dropping from gvfs moun
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: Support URI's in gcm_utils_is_icc_profile() to support dragging and dropping from gvfs moun
- Date: Thu, 18 Feb 2010 13:31:00 +0000 (UTC)
commit 9b39837030730fa1b0fec205ca9fc7309f354775
Author: Richard Hughes <richard hughsie com>
Date: Thu Feb 18 13:29:27 2010 +0000
trivial: Support URI's in gcm_utils_is_icc_profile() to support dragging and dropping from gvfs mounted archives
src/gcm-prefs.c | 2 +-
src/gcm-utils.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index c86bbbf..d8e03e7 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -586,7 +586,7 @@ gcm_prefs_drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, gin
continue;
/* check this is an ICC profile */
- file = g_file_new_for_path (filenames[i]);
+ file = g_file_new_for_uri (filenames[i]);
ret = gcm_utils_is_icc_profile (file);
if (!ret) {
egg_debug ("%s is not a ICC profile", filenames[i]);
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index 0362e03..078750e 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -85,7 +85,9 @@ gcm_utils_is_icc_profile (GFile *file)
gchar *filename = NULL;
/* get content type for file */
- filename = g_file_get_path (file);
+ filename = g_file_get_uri (file);
+ if (filename == NULL)
+ filename = g_file_get_path (file);
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, &error);
if (info != NULL) {
type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]