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 672272 - Refactor show()/hide() sequences
Refactor show()/hide() sequences
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-03-17 02:37 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-05-02 20:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Refactor show()/hide() sequences (8.79 KB, patch)
2012-03-17 02:37 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Refactor show()/hide() sequences (8.79 KB, patch)
2012-03-17 12:13 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
network: Fix an accidental copy-paste error (976 bytes, patch)
2012-05-02 20:31 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-03-17 02:37:44 UTC
See patch. Not trying to land this before hard code freeze -- this is 3.6 territory.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-03-17 02:37:46 UTC
Created attachment 209976 [details] [review]
Refactor show()/hide() sequences

We seem to have a lot of code that does something along the lines of:

    if (condition)
        actor.show();
    else
        actor.hide();

ClutterActor already has such a thing for exactly this purpose: the 'visible'
property. Use it instead of the mess above.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-03-17 12:13:46 UTC
Created attachment 209997 [details] [review]
Refactor show()/hide() sequences

We seem to have a lot of code that does something along the lines of:

    if (condition)
        actor.show();
    else
        actor.hide();

ClutterActor already has such a thing for exactly this purpose: the 'visible'
property. Use it instead of the mess above.
Comment 3 Giovanni Campagna 2012-03-17 18:07:26 UTC
Review of attachment 209997 [details] [review]:

Makes a lot of sense.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-05-02 18:00:23 UTC
Attachment 209997 [details] pushed as 723a1c8 - Refactor show()/hide() sequences
Comment 5 Cosimo Cecchi 2012-05-02 20:25:43 UTC
Review of attachment 209997 [details] [review]:

::: js/ui/status/network.js
@@ +708,3 @@
         // we can do it here because addConnection and removeConnection
         // both call _createSection at some point
+        this.section.actor.visible = this._connections.length <= 1;

Isn't this backwards? Old code used to hide the actor if connections.length was <= 1.
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-05-02 20:31:36 UTC
Created attachment 213334 [details] [review]
network: Fix an accidental copy-paste error

Logic swap accidentally introduced in commit 723a1c843.



Nice catch.
Comment 7 Cosimo Cecchi 2012-05-02 20:43:59 UTC
Review of attachment 213334 [details] [review]:

Yep, looks good!
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-05-02 20:47:42 UTC
Comment on attachment 213334 [details] [review]
network: Fix an accidental copy-paste error

Attachment 213334 [details] pushed as a5ac183 - network: Fix an accidental copy-paste error