From 37522842e63fe1d52d032f0927435acfcd539c74 Mon Sep 17 00:00:00 2001
From: Bassam <bassampervez@gmail.com>
Date: Wed, 30 Jun 2021 22:52:48 +0300
Subject: [PATCH] Add basic support for gtk-recent (Issue #257)

---
 thunar/thunar-io-scan-directory.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-io-scan-directory.c b/thunar/thunar-io-scan-directory.c
index 473cbe351..9be7cbb81 100644
--- a/thunar/thunar-io-scan-directory.c
+++ b/thunar/thunar-io-scan-directory.c
@@ -129,8 +129,21 @@ thunar_io_scan_directory (ThunarJob          *job,
             }
         }
 
-      /* create GFile for the child */
-      child_file = g_file_get_child (file, g_file_info_get_name (info));
+      /* check if file has 'recent' URI scheme */
+      if (g_file_has_uri_scheme (file, "recent"))
+        {
+          /* create Gfile using the target URI */
+          child_file = g_file_new_for_uri(g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI));
+
+          /* create new file info using Gfile*/
+          g_object_unref(info);
+          info = g_file_query_info (child_file, namespace, flags, cancellable, &err);
+        }
+      else
+        {
+          /* create GFile for the child */
+          child_file = g_file_get_child (file, g_file_info_get_name (info));
+        }
 
       if (return_thunar_files)
         {
-- 
GitLab