After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687025 - iconhelper: Treat empty string as NULL stock-id
iconhelper: Treat empty string as NULL stock-id
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-10-28 07:02 UTC by Murray Cumming
Modified: 2013-01-17 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-iconhelper-Treat-the-empty-string-as-a-NULL-stock-id.patch (933 bytes, patch)
2012-10-28 07:02 UTC, Murray Cumming
committed Details | Review
iconhelper: small code simplification (1.12 KB, patch)
2013-01-17 13:50 UTC, Sébastien Wilmet
committed Details | Review

Description Murray Cumming 2012-10-28 07:02:04 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
Comment 1 Matthias Clasen 2012-10-29 01:15:09 UTC
Review of attachment 227439 [details] [review]:

ok
Comment 2 Sébastien Wilmet 2013-01-04 16:30:37 UTC
Comment on attachment 227439 [details] [review]
0001-iconhelper-Treat-the-empty-string-as-a-NULL-stock-id.patch

Pushed to the master branch.
Comment 3 Christian Persch 2013-01-07 19:56:05 UTC
+  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?
Comment 4 Sébastien Wilmet 2013-01-17 13:49:26 UTC
I reopen the bug, since the code can be simplified. I will attach a patch.
Comment 5 Sébastien Wilmet 2013-01-17 13:50:13 UTC
Created attachment 233672 [details] [review]
iconhelper: small code simplification
Comment 6 Emmanuele Bassi (:ebassi) 2013-01-17 13:51:57 UTC
Review of attachment 233672 [details] [review]:

looks okay to me
Comment 7 Murray Cumming 2013-01-17 14:02:10 UTC
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 8 Sébastien Wilmet 2013-01-17 15:23:09 UTC
Comment on attachment 233672 [details] [review]
iconhelper: small code simplification

Pushed.