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 735976 - small switcherPopup cleanups
small switcherPopup cleanups
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: 2014-09-03 15:27 UTC by Rui Matos
Modified: 2014-09-11 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
switcherPopup: Ensure that we have items to show in a single place (1.54 KB, patch)
2014-09-03 15:27 UTC, Rui Matos
accepted-commit_now Details | Review
switcherPopup: Factor the initial selection into the base class (3.75 KB, patch)
2014-09-03 15:28 UTC, Rui Matos
committed Details | Review
status/keyboard: Remove unused variable (862 bytes, patch)
2014-09-03 15:28 UTC, Rui Matos
committed Details | Review
switcherPopup: Move _createSwitcher implementations into constructors (4.78 KB, patch)
2014-09-03 16:19 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2014-09-03 15:27:51 UTC
Just some drive-by cleanups
Comment 1 Rui Matos 2014-09-03 15:27:54 UTC
Created attachment 285260 [details] [review]
switcherPopup: Ensure that we have items to show in a single place

This way all subclasses benefit from this sanity check.
Comment 2 Rui Matos 2014-09-03 15:28:00 UTC
Created attachment 285261 [details] [review]
switcherPopup: Factor the initial selection into the base class

Only the application switcher needs to keep its own implementation
since it has two modes of operation depending on the binding.
Comment 3 Rui Matos 2014-09-03 15:28:06 UTC
Created attachment 285262 [details] [review]
status/keyboard: Remove unused variable
Comment 4 Florian Müllner 2014-09-03 15:37:31 UTC
Review of attachment 285260 [details] [review]:

LGTM

::: js/ui/switcherPopup.js
@@ +113,2 @@
     show: function(backward, binding, mask) {
+        if (!this._createSwitcher() || this._items.length == 0)

Would it make sense to swap the conditions? Or do we need to create the switcher in any case, even when we're not going to show it?
Comment 5 Florian Müllner 2014-09-03 15:39:53 UTC
Review of attachment 285262 [details] [review]:

Sure
Comment 6 Florian Müllner 2014-09-03 15:48:03 UTC
Review of attachment 285261 [details] [review]:

OK
Comment 7 Rui Matos 2014-09-03 16:19:36 UTC
Created attachment 285265 [details] [review]
switcherPopup: Move _createSwitcher implementations into constructors

We don't really need this step as a separate method since all
implementations are supposed to be created and shown immediately. This
also ensures that we have items to show in all subclasses.
--
(In reply to comment #4)

> Would it make sense to swap the conditions? Or do we need to create
> the switcher in any case, even when we're not going to show it?

Right. What about this patch instead?
Comment 8 Florian Müllner 2014-09-11 17:29:12 UTC
Review of attachment 285265 [details] [review]:

OK
Comment 9 Rui Matos 2014-09-11 17:36:01 UTC
Attachment 285261 [details] pushed as 2b1077a - switcherPopup: Factor the initial selection into the base class
Attachment 285262 [details] pushed as 19e3f79 - status/keyboard: Remove unused variable
Attachment 285265 [details] pushed as 547cdf8 - switcherPopup: Move _createSwitcher implementations into constructors