[cheese/wip/hadess/fix-infinite-loop: 3/3] Show better error when file info query fails




commit d2e32b97a055814af5f620d19ba49ea937730e57
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Sep 18 12:09:00 2020 +0200

    Show better error when file info query fails

 src/thumbview/cheese-thumb-view.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index 232fd4b6..f01b33df 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -113,12 +113,14 @@ cheese_thumb_view_idle_append_item (gpointer data)
   char                         *mime_type;
   char                         *uri;
   char                         *filename;
+  GError                       *error = NULL;
 
-  info = g_file_query_info (file, "standard::content-type,time::modified", 0, NULL, NULL);
+  info = g_file_query_info (file, "standard::content-type,time::modified", 0, NULL, &error);
 
   if (!info)
   {
-    g_warning ("Invalid filename\n");
+    g_warning ("Could not query file info: %s", error->message);
+    g_error_free (error);
     g_slice_free (CheeseThumbViewIdleData, item);
     return TRUE;
   }


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