sergio/takana
> Una distribución Linux construida con un laboratorio funcional y hermético en el > sótano, y una terminal mutable, clásica y anárquica en el piso de arriba — diseñada > desde el suelo para que una IA programadora entienda, modifique y co…
⎇ 6c864dcee3fe51ed8a49cb3bf74a03e658c5de50
recipes/incoming-clib/projectsdir.patch
Ñawpa willay
ch'uya
1From 5f3b178590df746544a48338f39025bf03aca46c Mon Sep 17 00:00:00 2001
2From: Emmanuele Bassi <ebassi@gnome.org>
3Date: Fri, 3 Apr 2026 12:17:31 +0100
4Subject: [PATCH] Support XDG_PROJECTS_DIR
5
6A new XDG user directory type, for non-document project files.
7
8See: https://gitlab.freedesktop.org/xdg/xdg-user-dirs/-/work_items/3
9---
10 gio/glocalfileinfo.c | 4 ++++
11 glib/gosxutils.m | 3 ++-
12 glib/gutils.c | 2 ++
13 glib/gutils.h | 9 +++++++++
14 glib/gutilsprivate.c | 5 +++++
15 5 files changed, 22 insertions(+), 1 deletion(-)
16
17diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
18index d2efb169eb..ec482988a6 100644
19--- a/gio/glocalfileinfo.c
20+++ b/gio/glocalfileinfo.c
21@@ -1840,6 +1840,10 @@ get_icon_name (const char *path,
22 {
23 name = use_symbolic ? "folder-pictures-symbolic" : "folder-pictures";
24 }
25+ else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_PROJECTS)) == 0)
26+ {
27+ name = use_symbolic ? "folder-projects-symbolic" : "folder-projects";
28+ }
29 else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_PUBLIC_SHARE)) == 0)
30 {
31 name = use_symbolic ? "folder-publicshare-symbolic" : "folder-publicshare";
32diff --git a/glib/gosxutils.m b/glib/gosxutils.m
33index 4d2d962ef4..13860a31ce 100644
34--- a/glib/gosxutils.m
35+++ b/glib/gosxutils.m
36@@ -43,7 +43,7 @@ find_folder (NSSearchPathDirectory type)
37 }
38
39 void
40-load_user_special_dirs_macos(gchar **table)
41+load_user_special_dirs_macos (gchar **table)
42 {
43 table[G_USER_DIRECTORY_DESKTOP] = find_folder (NSDesktopDirectory);
44 table[G_USER_DIRECTORY_DOCUMENTS] = find_folder (NSDocumentDirectory);
45@@ -53,4 +53,5 @@ load_user_special_dirs_macos(gchar **table)
46 table[G_USER_DIRECTORY_PUBLIC_SHARE] = find_folder (NSSharedPublicDirectory);
47 table[G_USER_DIRECTORY_TEMPLATES] = NULL;
48 table[G_USER_DIRECTORY_VIDEOS] = find_folder (NSMoviesDirectory);
49+ table[G_USER_DIRECTORY_PROJECTS] = find_folder (NSDocumentDirectory);
50 }
51diff --git a/glib/gutils.c b/glib/gutils.c
52index 02da41b688..90bd3bc3e7 100644
53--- a/glib/gutils.c
54+++ b/glib/gutils.c
55@@ -2243,6 +2243,8 @@ load_user_special_dirs_unlocked (void)
56
57 g_user_special_dirs[G_USER_DIRECTORY_TEMPLATES] = get_special_folder (&FOLDERID_Templates);
58 g_user_special_dirs[G_USER_DIRECTORY_VIDEOS] = get_special_folder (&FOLDERID_Videos);
59+
60+ g_user_special_dirs[G_USER_DIRECTORY_PROJECTS] = get_special_folder (&FOLDERID_Documents);
61 }
62
63 #else /* default is unix */
64diff --git a/glib/gutils.h b/glib/gutils.h
65index dce1541ed7..f111938cae 100644
66--- a/glib/gutils.h
67+++ b/glib/gutils.h
68@@ -248,6 +248,15 @@ typedef enum {
69 G_USER_DIRECTORY_TEMPLATES,
70 G_USER_DIRECTORY_VIDEOS,
71
72+ /**
73+ * G_USER_DIRECTORY_PROJECTS:
74+ *
75+ * The user's Projects directory.
76+ *
77+ * Since: 2.90
78+ */
79+ G_USER_DIRECTORY_PROJECTS,
80+
81 G_USER_N_DIRECTORIES
82 } GUserDirectory;
83
84diff --git a/glib/gutilsprivate.c b/glib/gutilsprivate.c
85index 3b9206c45c..f8dac99ec0 100644
86--- a/glib/gutilsprivate.c
87+++ b/glib/gutilsprivate.c
88@@ -89,6 +89,11 @@ load_user_special_dirs_from_string (const gchar *string, const gchar *home_dir,
89 directory = G_USER_DIRECTORY_VIDEOS;
90 p += strlen ("XDG_VIDEOS_DIR");
91 }
92+ else if (strncmp (p, "XDG_PROJECTS_DIR", strlen ("XDG_PROJECTS_DIR")) == 0)
93+ {
94+ directory = G_USER_DIRECTORY_PROJECTS;
95+ p += strlen ("XDG_PROJECTS_DIR");
96+ }
97 else
98 continue;
99
100--
101GitLab
102