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 755763 - [PATCH] Remove gs_app_row_set_app() and gs_app_addon_row_set_addon()
[PATCH] Remove gs_app_row_set_app() and gs_app_addon_row_set_addon()
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-09-28 22:30 UTC by Rafal Luzynski
Modified: 2015-10-07 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes the problem (8.41 KB, patch)
2015-09-28 22:45 UTC, Rafal Luzynski
committed Details | Review

Description Rafal Luzynski 2015-09-28 22:30:29 UTC
In bug 755664 comment 6 Kalev has written that gs_app_row_set_app() is supposed to be called only once. This can be ensured by an assert which of course may fail only at run time. To ensure at compile time that this function is not called now nor ever in future it is better to remove this function (or make it private) and set the app only by the gs_app_row_new().

The same applies to gs_app_addon_row_set_addon().
Comment 1 Rafal Luzynski 2015-09-28 22:45:04 UTC
Created attachment 312330 [details] [review]
Fixes the problem

The solution for GsAppRow turned out to be a little tricky because gs_app_row_set_app() also calls gs_app_row_refresh(). This had to be added to some gs_app_row_set_***() implementations to ensure that the appearance of an app row reflects its internal state.
Comment 2 Kalev Lember 2015-10-07 11:40:40 UTC
Review of attachment 312330 [details] [review]:

Looks good to me, thanks!