[opensuse-packaging] Patch review needed.
Hi. 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... https://build.opensuse.org/package/view_file/home:jcsl:test/lxpanel/lxpanel-... Thanks in advance. Greetings. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Thu, 2015-08-20 at 13:16 +0200, 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...
https://build.opensuse.org/package/view_file/home:jcsl:test/lxpanel/lxpanel-...
I'm not an LXDE hacker, but purely from a C/GTK+ perspective, the patch looks fine to me. I'd change if (dir) while (dir[0]) { ... } to if (dir) { while (dir[0]) { } } for clarity, though. -- Hans Petter -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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
participants (3)
-
Hans Petter Jansson
-
Jan Engelhardt
-
jcsl