[gedit] Don't save metadata for untitled documents with fallback manager
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Don't save metadata for untitled documents with fallback manager
- Date: Sun, 18 Apr 2010 11:02:59 +0000 (UTC)
commit 773b1498261b4ac8d8505a44f24cfc67910ccae7
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sun Apr 18 13:02:41 2010 +0200
Don't save metadata for untitled documents with fallback manager
gedit/gedit-document.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 2149ef9..0f9b56d 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -2581,8 +2581,10 @@ gedit_document_get_metadata (GeditDocument *doc,
g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL);
g_return_val_if_fail (key != NULL, NULL);
- if (doc->priv->uri != NULL)
+ if (!gedit_document_is_untitled (doc))
+ {
value = gedit_metadata_manager_get (doc->priv->uri, key);
+ }
return value;
}
@@ -2599,6 +2601,12 @@ gedit_document_set_metadata (GeditDocument *doc,
g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
g_return_if_fail (first_key != NULL);
+ if (gedit_document_is_untitled (doc))
+ {
+ /* Can't set metadata for untitled documents */
+ return;
+ }
+
va_start (var_args, first_key);
for (key = first_key; key; key = va_arg (var_args, const gchar *))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]