On Thursday 2015-08-20 13:16, jcsl wrote:
I'd like to add a patch to LXPanel for it to make a systemwide themes search. I don't know neither C nor GTK so I'm not sure about the quality and possible bugs in the patch. I did my best but...
+ file = _user_config_file_name("gtkrc", NULL); + if (!g_file_test (file, G_FILE_TEST_EXISTS))
Does g_file_test handle NULL? If not, you should add a check.
+ { + /* try XDG fallbacks */ + g_free(file); + file = NULL; + const gchar * const * dir = g_get_system_config_dirs(); + if (dir) while (dir[0]) + { + file = _system_config_file_name(dir[0], "gtkrc"); + if (g_file_test (file, G_FILE_TEST_EXISTS)) + break; + g_free(file); + file = NULL; + dir++; + } + + /* last try at old fallback for compatibility reasons */ + if (!file) + file = _old_system_config_file_name("gtkrc"); + } -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org