[gedit] GeditDocument: make sure that metadata_info exists



commit 52f9ac2f5bbae5c296b009a6034ce2fad8ccc6e9
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Aug 17 19:11:03 2015 +0200

    GeditDocument: make sure that metadata_info exists
    
    To fix this warning:
    CRITICAL **: set_gvfs_metadata: assertion 'G_IS_FILE_INFO (info)' failed
    
    The bug occurred when opening a non-existing file from the command line,
    and changing something (e.g. enable the spell checking) that sets a
    metadata.
    
    An empty GFileInfo is used to collect the metadata even if the file
    doesn't exist. So when the file is saved, the metadata isn't lost.

 gedit/gedit-document.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 527495c..7bf1eb0 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -802,6 +802,11 @@ on_location_changed (GtkSourceFile *file,
 
                        g_error_free (error);
                }
+
+               if (priv->metadata_info == NULL)
+               {
+                       priv->metadata_info = g_file_info_new ();
+               }
        }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]