[lookandfeel] Document types of a user list model

wilder-5.26
ivan tkachenko 4 years ago
parent 79b5eb22a6
commit e2a842a0d0
No known key found for this signature in database
GPG Key ID: AF72731B7C654CB3
  1. 1
      components/sessionsprivate/sessionsmodel.h
  2. 24
      lookandfeel/contents/components/SessionManagementScreen.qml
  3. 18
      lookandfeel/contents/components/UserList.qml

@ -33,6 +33,7 @@ struct SessionEntry {
class KDisplayManager;
// This model should be compatible with SDDM::SessionModel
class SessionsModel : public QAbstractListModel
{
Q_OBJECT

@ -30,16 +30,22 @@ FocusScope {
property alias actionItemsVisible: actionItemsLayout.visible
/*
* A model with a list of users to show in the view
* The following roles should exist:
* - name
* - iconSource
* A model with a list of users to show in the view.
* There are different implementations in sddm greeter (UserModel) and
* KScreenLocker (SessionsModel), so some roles will be missing.
*
* The following are also handled:
* - vtNumber
* - displayNumber
* - session
* - isTty
* type: {
* name: string,
* realName: string,
* homeDir: string,
* icon: string,
* iconName?: string,
* needsPassword?: bool,
* displayNumber?: string,
* vtNumber?: int,
* session?: string
* isTty?: bool,
* }
*/
property alias userListModel: userListView.model

@ -8,6 +8,24 @@ import QtQuick 2.15
import org.kde.plasma.core 2.0 as PlasmaCore
/*
* A model with a list of users to show in the view.
* There are different implementations in sddm greeter (UserModel) and
* KScreenLocker (SessionsModel), so some roles will be missing.
*
* type: {
* name: string,
* realName: string,
* homeDir: string,
* icon: string,
* iconName?: string,
* needsPassword?: bool,
* displayNumber?: string,
* vtNumber?: int,
* session?: string
* isTty?: bool,
* }
*/
ListView {
id: view
readonly property string selectedUser: currentItem ? currentItem.userName : ""

Loading…
Cancel
Save