Remove utils_make_filename() - use g_strconcat instead
This commit is contained in:
parent
402249f1b8
commit
e7befb410c
@ -1276,10 +1276,10 @@ static gchar *filetypes_get_filename(GeanyFiletype *ft, gboolean user)
|
||||
gchar *f;
|
||||
|
||||
if (user)
|
||||
f = utils_make_filename(app->configdir,
|
||||
f = g_strconcat(app->configdir, G_DIR_SEPARATOR_S
|
||||
GEANY_FILEDEFS_SUBDIR G_DIR_SEPARATOR_S, "filetypes.", ext, NULL);
|
||||
else
|
||||
f = utils_make_filename(app->datadir, "filetypes.", ext, NULL);
|
||||
f = g_strconcat(app->datadir, G_DIR_SEPARATOR_S "filetypes.", ext, NULL);
|
||||
|
||||
g_free(ext);
|
||||
return f;
|
||||
|
24
src/utils.c
24
src/utils.c
@ -1793,30 +1793,6 @@ gchar *utils_build_path(const gchar *first, ...)
|
||||
}
|
||||
|
||||
|
||||
/* Concatenates a path with other strings.
|
||||
* @param path A path, which will have a separator added before the other strings.
|
||||
* @param ... Strings to concatenate (no directory separators will be
|
||||
* inserted between them).
|
||||
* E.g. filename = utils_make_filename(app->datadir, "filetypes.", ext, NULL); */
|
||||
gchar *utils_make_filename(const gchar *path, ...)
|
||||
{
|
||||
static GString *buffer = NULL;
|
||||
va_list args;
|
||||
|
||||
if (! buffer)
|
||||
buffer = g_string_new(path);
|
||||
else
|
||||
g_string_assign(buffer, path);
|
||||
|
||||
g_string_append_c(buffer, G_DIR_SEPARATOR);
|
||||
|
||||
va_start(args, path);
|
||||
utils_string_vappend(buffer, NULL, args);
|
||||
va_end(args);
|
||||
return g_strdup(buffer->str);
|
||||
}
|
||||
|
||||
|
||||
/* Retrieves the path for the given URI.
|
||||
* It returns:
|
||||
* - the path which was determined by g_filename_from_uri() or GIO
|
||||
|
@ -266,8 +266,6 @@ gint utils_str_casecmp(const gchar *s1, const gchar *s2);
|
||||
|
||||
gchar *utils_build_path(const gchar *first, ...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
gchar *utils_make_filename(const gchar *path, ...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
gchar *utils_get_path_from_uri(const gchar *uri);
|
||||
|
||||
gboolean utils_is_uri(const gchar *uri);
|
||||
|
Loading…
x
Reference in New Issue
Block a user