Check if a resource exists



Hello,

Recently when dealing with css providers I have been trying to figure
out a way to check if a given resource exists. This is something that
can be achieved by using the error parameter in some functions[0] in
GTK 3.0 but it does not exist anymore in GTK 4.0.

I could create a GFile with a resource uri by using g_file_new_for_uri
and then use g_file_query_exists, but it does not seem the best way
for doing so.

So my question is, what is the proper way of checking if a resource
exists regarding future compatibility?

Best regards,

[0] gtk_css_provider_load_from_file, gtk_css_provider_load_from_data,
gtk_css_provider_load_from_path


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]