Fix the user switcher not updating open sessions
ClosedPublic

Authored by fernando on Dec 16 2017, 8:39 AM.

Details

Summary

Hey guys,

Sorry this is a bit out of the blue, but Bug #386254 was infuriating me so much for the past few days that I patched it locally. I figured I may as well submit a code review in case my fix is what a plasma dev would end up doing anyway.

It seems that the Connections object wasn't actually connecting to the signals, preventing the sessionsModel from reloading. I'm not entirely sure why (maybe to do with when the component actually gets loaded?), I found 2 workarounds:

  • moving the Connections object up to the parent scope
  • creating the binding in JavaScript

Maybe I don't remember the QML identifier scoping rules super well, (or there was some other actual issue) but I got a ton of reference errors when attempting the first workaround. However, the second worked.

Test Plan

I don't know if plasma has any automated UI regression tests, so I verified it manually. On my machine the sessions list now updates when I create/remove sessions, but everything else seemed to function as normal.

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
fernando created this revision.Dec 16 2017, 8:39 AM
Restricted Application added a subscriber: plasma-devel. · View Herald TranscriptDec 16 2017, 8:39 AM
fernando requested review of this revision.Dec 16 2017, 8:39 AM
broulik added a subscriber: broulik.Jan 4 2018, 3:11 PM

Oh, I'm so sorry, I missed your patch, and actually did a patch of my own. Just remove the console.log and your patch is good to go!
Do you have commit access?

applets/userswitcher/package/contents/ui/main.qml
244

Please remove this comment

fernando updated this revision to Diff 24815.Jan 6 2018, 7:45 AM
fernando marked an inline comment as done.

Removed log statement I originally added for debugging.

Thanks. Here's an updated diff without the console.log().

As for commit access, I had it a very long time ago, but I have no idea if my key will still work.
I'll try to push and let you know if I can't.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 10 2018, 5:52 AM
This revision was automatically updated to reflect the committed changes.