[gedit] Minor fix in the metadata api.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Minor fix in the metadata api.
- Date: Mon, 30 Nov 2009 11:58:02 +0000 (UTC)
commit 8b4e5afeed9ad2edbb005897965b5c4c3aaed28b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Nov 30 12:55:37 2009 +0100
Minor fix in the metadata api.
Do not return NULL if the internal metadata is NULL because we can
save the document and set the attributes after that.
gedit/gedit-document.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 9f6d426..4d10f9e 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -2554,9 +2554,6 @@ filter_metadata_attributes (GeditDocument *doc,
GFileInfo *metadata_info;
gchar **attributes, **ptr;
- if (doc->priv->metadata_info == NULL)
- return NULL;
-
if (g_file_info_has_namespace (info, "metadata"))
attributes = g_file_info_list_attributes (info, "metadata");
else
@@ -2579,8 +2576,9 @@ filter_metadata_attributes (GeditDocument *doc,
type, value);
/* Update the internal metadata info */
- g_file_info_set_attribute (doc->priv->metadata_info, *ptr,
- type, value);
+ if (doc->priv->metadata_info != NULL)
+ g_file_info_set_attribute (doc->priv->metadata_info, *ptr,
+ type, value);
}
return metadata_info;
@@ -2613,14 +2611,18 @@ gedit_document_set_metadata (GeditDocument *doc,
location = gedit_document_get_location (doc);
- g_file_set_attributes_async (location,
- metadata_info,
- G_FILE_QUERY_INFO_NONE,
- G_PRIORITY_DEFAULT,
- NULL,
- set_attributes_cb,
- NULL);
+ if (location != NULL)
+ {
+ g_file_set_attributes_async (location,
+ metadata_info,
+ G_FILE_QUERY_INFO_NONE,
+ G_PRIORITY_DEFAULT,
+ NULL,
+ set_attributes_cb,
+ NULL);
- g_object_unref (location);
+ g_object_unref (location);
+ }
+
g_object_unref (metadata_info);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]