• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From a9394bd68e222377f0156bf9c213b3f3a1e340d0 Mon Sep 17 00:00:00 2001
2From: Emmanuele Bassi <ebassi@gnome.org>
3Date: Sat, 30 Jul 2022 20:03:42 +0100
4Subject: [PATCH] Implement GFileIface.set_display_name() for resource files
5
6Resource files cannot be renamed, and GFileIface.set_display_name() is
7mandatory.
8
9Fixes: #2705
10
11Conflict:NA
12Reference:https://gitlab.gnome.org/GNOME/glib/-/commit/a9394bd68e222377f0156bf9c213b3f3a1e340d0
13
14---
15 gio/gresourcefile.c | 14 ++++++++++++++
16 1 file changed, 14 insertions(+)
17
18diff --git a/gio/gresourcefile.c b/gio/gresourcefile.c
19index 340d3378b3..24f20f2903 100644
20--- a/gio/gresourcefile.c
21+++ b/gio/gresourcefile.c
22@@ -646,6 +646,19 @@ g_resource_file_monitor_file (GFile              *file,
23   return g_object_new (g_resource_file_monitor_get_type (), NULL);
24 }
25
26+static GFile *
27+g_resource_file_set_display_name (GFile         *file,
28+                                  const char    *display_name,
29+                                  GCancellable  *cancellable,
30+                                  GError       **error)
31+{
32+  g_set_error_literal (error,
33+                       G_IO_ERROR,
34+                       G_IO_ERROR_NOT_SUPPORTED,
35+                       _("Resource files cannot be renamed"));
36+  return NULL;
37+}
38+
39 static void
40 g_resource_file_file_iface_init (GFileIface *iface)
41 {
42@@ -664,6 +677,7 @@ g_resource_file_file_iface_init (GFileIface *iface)
43   iface->get_relative_path = g_resource_file_get_relative_path;
44   iface->resolve_relative_path = g_resource_file_resolve_relative_path;
45   iface->get_child_for_display_name = g_resource_file_get_child_for_display_name;
46+  iface->set_display_name = g_resource_file_set_display_name;
47   iface->enumerate_children = g_resource_file_enumerate_children;
48   iface->query_info = g_resource_file_query_info;
49   iface->query_filesystem_info = g_resource_file_query_filesystem_info;
50--
51GitLab
52
53