GNOME Bugzilla – Bug 736910
appDisplay: Hide empty app folders
Last modified: 2014-09-25 05:32:48 UTC
See patch.
Created attachment 286504 [details] [review] appDisplay: Hide empty app folders Trying to open an empty folder currently leaves the parent view in a rather confused state. While we should look into fixing this in the future, empty folders are not useful at all to begin with, so hide them.
Review of attachment 286504 [details] [review]: The code looks a little confusing(why hide the actor? Why actor.show for each app?), but I don't have a better proposal. So LGTM.
(In reply to comment #2) > The code looks a little confusing(why hide the actor? Why actor.show for each > app?), but I don't have a better proposal. Well, an alternative would be to do something like this.actor.visible = this.view.getAllItems().length > 0; at the end of _redisplay() ...
(In reply to comment #3) > (In reply to comment #2) > > The code looks a little confusing(why hide the actor? Why actor.show for each > > app?), but I don't have a better proposal. > > Well, an alternative would be to do something like > > this.actor.visible = this.view.getAllItems().length > 0; > > at the end of _redisplay() ... That could be better, but do we need to also make sure at least one app pass the set of ifs: if (excludedApps.indexOf(appId) >= 0) return; let app = appSys.lookup_app(appId); if (!app) return; if (!app.get_app_info().should_show()) return; So maybe the code looks worse in this case. If I'm wrong in this, then your new proposal looks indeed better.
Created attachment 286527 [details] [review] appDisplay: Hide empty app folders (In reply to comment #4) > (In reply to comment #3) > > Well, an alternative would be to do something like > > > > this.actor.visible = this.view.getAllItems().length > 0; > > > > at the end of _redisplay() ... > > That could be better, but do we need to also make sure at least one app pass > the set of ifs: > if (excludedApps.indexOf(appId) >= 0) > return; apps that don's pass any of those tests are not added in the first place, so the attached patch handles this just fine ...
Review of attachment 286527 [details] [review]: Right, I was reading it as a function called after this function scope. But it's not. LBetterTM now.
Attachment 286527 [details] pushed as 3ae45bd - appDisplay: Hide empty app folders
*** Bug 709962 has been marked as a duplicate of this bug. ***