mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-03 02:08:00 +02:00
wp: make wp_get_xdg_state_dir() private
It's not used elsewhere, so there is no good reason yet to expose it. Besides, I expect that GLib will likely add a method in the future to return the XDG_STATE_HOME (which is relatively new in the xdg spec)
This commit is contained in:
parent
27ed36c2da
commit
3cd9384805
3 changed files with 17 additions and 24 deletions
|
|
@ -138,6 +138,23 @@ struct _WpState
|
|||
|
||||
G_DEFINE_TYPE (WpState, wp_state, G_TYPE_OBJECT)
|
||||
|
||||
/* Gets the full path to the WirePlumber XDG_STATE_HOME subdirectory */
|
||||
static const gchar *
|
||||
wp_get_xdg_state_dir (void)
|
||||
{
|
||||
static gchar xdg_dir[PATH_MAX] = {0};
|
||||
if (xdg_dir[0] == '\0') {
|
||||
g_autofree gchar *path = NULL;
|
||||
g_autofree gchar *base = g_strdup (g_getenv ("XDG_STATE_HOME"));
|
||||
if (!base)
|
||||
base = g_build_filename (g_get_home_dir (), ".local", "state", NULL);
|
||||
|
||||
path = g_build_filename (base, "wireplumber", NULL);
|
||||
(void) g_strlcpy (xdg_dir, path, sizeof (xdg_dir));
|
||||
}
|
||||
return xdg_dir;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_new_location (const char *name)
|
||||
{
|
||||
|
|
|
|||
21
lib/wp/wp.c
21
lib/wp/wp.c
|
|
@ -77,27 +77,6 @@ wp_get_module_dir (void)
|
|||
return module_dir;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the full path to the WirePlumber XDG_STATE_HOME subdirectory
|
||||
* \returns WirePlumber's XDG_STATE_HOME subdirectory
|
||||
* \since 0.4.2
|
||||
*/
|
||||
const gchar *
|
||||
wp_get_xdg_state_dir (void)
|
||||
{
|
||||
static gchar xdg_dir[PATH_MAX] = {0};
|
||||
if (xdg_dir[0] == '\0') {
|
||||
g_autofree gchar *path = NULL;
|
||||
g_autofree gchar *base = g_strdup (g_getenv ("XDG_STATE_HOME"));
|
||||
if (!base)
|
||||
base = g_build_filename (g_get_home_dir (), ".local", "state", NULL);
|
||||
|
||||
path = g_build_filename (base, "wireplumber", NULL);
|
||||
(void) g_strlcpy (xdg_dir, path, sizeof (xdg_dir));
|
||||
}
|
||||
return xdg_dir;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the full path to the WirePlumber configuration directory
|
||||
* \returns The WirePlumber configuration directory
|
||||
|
|
|
|||
|
|
@ -66,9 +66,6 @@ void wp_init (WpInitFlags flags);
|
|||
WP_API
|
||||
const gchar * wp_get_module_dir (void);
|
||||
|
||||
WP_API
|
||||
const gchar * wp_get_xdg_state_dir (void);
|
||||
|
||||
WP_API
|
||||
G_DEPRECATED_FOR (wp_find_file)
|
||||
const gchar * wp_get_config_dir (void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue