Commit 3cd93848 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

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)
parent 27ed36c2
Pipeline #384464 passed with stages
in 1 minute and 31 seconds
......@@ -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)
{
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment