GNOME Bugzilla – Bug 687025
iconhelper: Treat empty string as NULL stock-id
Last modified: 2013-01-17 15:23:20 UTC
Created attachment 227439 [details] [review] 0001-iconhelper-Treat-the-empty-string-as-a-NULL-stock-id.patch This patch avoids the warnings (about NULL icon_set) that appear with recent GTK+ versions when passing "" as the stock-id, as gtkmm currently does. A similar regression was fixed recently for the icon-name: http://git.gnome.org/browse/gtk+/commit/gtk/gtkiconhelper.c?id=f0714338b3c5810b2ca1de3aaa4ba0683c055ff5
Review of attachment 227439 [details] [review]: ok
Comment on attachment 227439 [details] [review] 0001-iconhelper-Treat-the-empty-string-as-a-NULL-stock-id.patch Pushed to the master branch.
+ if (stock_id != NULL && + g_strcmp0 (stock_id, "") != 0) Why g_strcmp0? you just made sure stock_id is not NULL. Also why strcmp when just stock_id[0] != '\0' would do?
I reopen the bug, since the code can be simplified. I will attach a patch.
Created attachment 233672 [details] [review] iconhelper: small code simplification
Review of attachment 233672 [details] [review]: looks okay to me
I think I was just copying the existing commit: http://git.gnome.org/browse/gtk+/commit/gtk/gtkiconhelper.c?id=f0714338b3c5810b2ca1de3aaa4ba0683c055ff5 It looks like you improved that too. Thanks.
Comment on attachment 233672 [details] [review] iconhelper: small code simplification Pushed.