lib: Delete old GFile path helpers, and migrate single last user
I happened to read this file and realized there's a lot of cruft left over from the time when I liked `GFile` and `malloc()`ing like 50 times just to make a pathname string. Delete it. Closes: #767 Approved by: jlebon
This commit is contained in:
1 parent
b51ce8cb0a
commit
8392faaffc
3 files changed
+2
-93
No files matched your search
@@ -51,91 +51,6 @@ ot_gfile_type_for_mode (guint32 mode)
|
||||
}
|
||||
|
||||
|
||||
GFile *
|
||||
ot_gfile_from_build_path (const char *first, ...)
|
||||
{
|
||||
va_list args;
|
||||
const char *arg;
|
||||
g_autofree char *path = NULL;
|
||||
g_autoptr(GPtrArray) components = NULL;
|
||||
|
||||
va_start (args, first);
|
||||
|
||||
components = g_ptr_array_new ();
|
||||
|
||||
arg = first;
|
||||
while (arg != NULL)
|
||||
{
|
||||
g_ptr_array_add (components, (char*)arg);
|
||||
arg = va_arg (args, const char *);
|
||||
}
|
||||
|
||||
va_end (args);
|
||||
|
||||
g_ptr_array_add (components, NULL);
|
||||
|
||||
path = g_build_filenamev ((char**)components->pdata);
|
||||
|
||||
return g_file_new_for_path (path);
|
||||
}
|
||||
|
||||
GFile *
|
||||
ot_gfile_get_child_strconcat (GFile *parent,
|
||||
const char *first,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
GFile *ret;
|
||||
GString *buf;
|
||||
const char *arg;
|
||||
|
||||
g_return_val_if_fail (first != NULL, NULL);
|
||||
|
||||
va_start (args, first);
|
||||
|
||||
buf = g_string_new (first);
|
||||
|
||||
while ((arg = va_arg (args, const char *)) != NULL)
|
||||
g_string_append (buf, arg);
|
||||
|
||||
va_end (args);
|
||||
|
||||
ret = g_file_get_child (parent, buf->str);
|
||||
|
||||
g_string_free (buf, TRUE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GFile *
|
||||
ot_gfile_get_child_build_path (GFile *parent,
|
||||
const char *first, ...)
|
||||
{
|
||||
va_list args;
|
||||
const char *arg;
|
||||
g_autofree char *path = NULL;
|
||||
g_autoptr(GPtrArray) components = NULL;
|
||||
|
||||
va_start (args, first);
|
||||
|
||||
components = g_ptr_array_new ();
|
||||
|
||||
arg = first;
|
||||
while (arg != NULL)
|
||||
{
|
||||
g_ptr_array_add (components, (char*)arg);
|
||||
arg = va_arg (args, const char *);
|
||||
}
|
||||
|
||||
va_end (args);
|
||||
|
||||
g_ptr_array_add (components, NULL);
|
||||
|
||||
path = g_build_filenamev ((char**)components->pdata);
|
||||
|
||||
return g_file_resolve_relative_path (parent, path);
|
||||
}
|
||||
|
||||
GFile *
|
||||
ot_gfile_resolve_path_printf (GFile *path,
|
||||
const char *format,
|
||||
|
||||
Reference in new issue
Block a user