[gedit/wip/loader-saver: 37/48] GeditDocument: ignore not found error for the query info



commit 878f06a25e1d159e5dd6e9bcd0d88e22e1b99cf7
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jun 28 22:39:48 2014 +0200

    GeditDocument: ignore not found error for the query info

 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 1b2ce96..a432a35 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -1051,7 +1051,15 @@ loaded_query_info_cb (GFile         *location,
 
        if (error != NULL)
        {
-               g_warning ("Document loading: query info error: %s", error->message);
+               /* Ignore not found error as it can happen when opening a
+                * non-existent file from the command line.
+                */
+               if (error->domain != G_IO_ERROR ||
+                   error->code != G_IO_ERROR_NOT_FOUND)
+               {
+                       g_warning ("Document loading: query info error: %s", error->message);
+               }
+
                g_error_free (error);
                error = NULL;
        }


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