[gnome-text-editor] page: special case admin:// URIs for subtitle



commit d6d545faea38cf60a474f8d877b8a8b2149a5a5a
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jan 10 15:07:41 2022 -0800

    page: special case admin:// URIs for subtitle

 src/editor-page.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/editor-page.c b/src/editor-page.c
index bfe4bd9..e91890f 100644
--- a/src/editor-page.c
+++ b/src/editor-page.c
@@ -974,7 +974,19 @@ editor_page_dup_subtitle (EditorPage *self)
     return g_strdup (_("Draft"));
 
   if (!g_file_is_native (dir))
-    return g_file_get_uri (dir);
+  {
+    g_autofree char *uri = g_file_get_uri (dir);
+
+    if (g_str_has_prefix (uri, "admin:///"))
+      {
+        const char *path = uri + strlen ("admin://");
+
+        /* translators: %s is replaced with the path on the filesystem */
+        return g_strdup_printf (_("%s (Administrator)"), path);
+      }
+
+    return g_steal_pointer (&uri);
+  }
 
   return _editor_path_collapse (g_file_peek_path (dir));
 }


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