[seahorse] Fix #556670
- From: Jeff Cai <jeffcai src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [seahorse] Fix #556670
- Date: Fri, 6 Nov 2009 04:13:29 +0000 (UTC)
commit 31bdeb23a74f2810c4ab10e89a806a44ffba7537
Author: Jeff Cai <jeff cai sun com>
Date: Fri Nov 6 12:10:30 2009 +0800
Fix #556670
This patch can fix the error that happens when a user imports a SSH key file.
But it doesn't fix the issue when importing from the clipboard.
libseahorse/seahorse-util.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/libseahorse/seahorse-util.c b/libseahorse/seahorse-util.c
index 138f162..da343c7 100644
--- a/libseahorse/seahorse-util.c
+++ b/libseahorse/seahorse-util.c
@@ -846,14 +846,26 @@ GQuark
seahorse_util_detect_file_type (const gchar *uri)
{
gboolean uncertain;
- gchar *mime;
+ gchar *mime = NULL;
GQuark type;
+ GFile *file;
+ GFileInfo *info;
+
+ file = g_file_new_for_uri (uri);
+ info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ 0,
+ NULL,
+ NULL);
+
+ g_return_val_if_fail (info, 0);
+
+ mime = g_file_info_get_content_type (info);
- mime = g_content_type_guess (uri, NULL, 0, &uncertain);
g_return_val_if_fail (mime, 0);
type = seahorse_util_detect_mime_type (mime);
- g_free (mime);
+ g_object_unref (info);
return type;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]