Only the button if there's a session to switch to and/or the user is allowed to launch a new session.
Details
Details
Default setup, no other session: Got the button with a switch user entry
Disabled new session starting via kiosk restriction: No swtich user entry
Started a new session on console: Got the button again
Diff Detail
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
If switching is disabled, we still want to hide the button.
I think we need:
(count > 0 || canStartNew) && canSwitch
bool SessionsModel::canSwitchUser() const
{
return const_cast<SessionsModel *>(this)->m_displayManager.isSwitchable() && KAuthorized::authorizeAction(QLatin1String("switch_user"));
}
bool SessionsModel::canStartNewSession() const
{
return const_cast<SessionsModel *>(this)->m_displayManager.numReserve() > 0 && KAuthorized::authorizeAction(QLatin1String("start_new_session"));
}