In src/utils.c:

> @@ -2188,3 +2188,91 @@ void utils_start_new_geany_instance(const gchar *doc_path)
>  	else
>  		g_printerr("Unable to find 'geany'");
>  }
> +
> +
> +static GFile *utils_gfile_create(const gchar *fname)
> +{
> +	if (utils_is_uri(fname))
> +		return g_file_new_for_uri(fname);
> +	return g_file_new_for_path(fname);
> +}
> +
> +
> +/**
> + *  Tests file existence using the configured IO method in Geany.
> + *
> + *  @param fname File name.

When you have a look at the plugins the patch affects, they do (maybe not all the g_file_test()s deal with possibly remote files but some definitely do).

But the question is good - we probably shouldn't make an utility function for every single IO function - instead there should be something like

utils_use_gio()

and plugins should use it as needed (we'll already need this for the saveaction plugin which needs to be updated to make a backup copy of a possibly remote file). This will lead to a minor code duplication in the plugins but I think from the API perspective this is the right way. What do you think?

The other question is whether to make such a function inside utils or somewhere else (prefs?) or whether to make it e.g. a variable in some config struct. Ideas?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub