[gnome-text-editor] page: collapse admin directories
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] page: collapse admin directories
- Date: Tue, 11 Jan 2022 00:08:50 +0000 (UTC)
commit ace231272aab4d621384146e42c2c56e857391fe
Author: Christian Hergert <chergert redhat com>
Date: Mon Jan 10 16:08:26 2022 -0800
page: collapse admin directories
src/editor-page.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/editor-page.c b/src/editor-page.c
index e91890f..462608a 100644
--- a/src/editor-page.c
+++ b/src/editor-page.c
@@ -974,19 +974,20 @@ editor_page_dup_subtitle (EditorPage *self)
return g_strdup (_("Draft"));
if (!g_file_is_native (dir))
- {
- g_autofree char *uri = 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://");
+ if (g_str_has_prefix (uri, "admin:///"))
+ {
+ const char *suffix = uri + strlen ("admin://");
+ g_autofree char *path = _editor_path_collapse (suffix);
- /* translators: %s is replaced with the path on the filesystem */
- return g_strdup_printf (_("%s (Administrator)"), path);
- }
+ /* translators: %s is replaced with the path on the filesystem */
+ return g_strdup_printf (_("%s (Administrator)"), path);
+ }
- return g_steal_pointer (&uri);
- }
+ 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]