ui->hostnameLabel->setText(QLightDM::System::hostname());
- ui->userListView->setModel(QLightDM::users());
+ ui->userListView->setModel(new QLightDM::UsersModel(this));
connect(ui->loginButton, SIGNAL(released()), SLOT(onLoginButtonClicked()));
connect(m_greeter, SIGNAL(authenticationComplete()), SLOT(onAuthenticationComplete()));
powerMenu->addAction(hibernateAction);
ui->powerOptionsButton->setMenu(powerMenu);
- ui->sessionCombo->setModel(QLightDM::sessions());
+ ui->sessionCombo->setModel(new QLightDM::SessionsModel(this));
}
QString Panel::session() const
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QComboBox" name="languageCombo"/>
- </item>
- <item>
- <widget class="QComboBox" name="layoutCombo"/>
- </item>
<item>
<widget class="QComboBox" name="sessionCombo"/>
</item>
SessionsModelPrivate *d;
void buildList(); //maybe make this a public slot, which apps can call only if they give a care about the session.
};
-
- SessionsModel *sessions();
};
#endif // QLIGHTDM_SESSION_H
QList<UserItem> getUsers() const;
};
-UsersModel *users();
-}
+};
#endif // QLIGHTDM_USER_H
class SessionItem
{
public:
- //FIXME can I make these consts, if I set them in a lovely constructor?
QString id;
QString name;
QString comment;
};
-static SessionsModel *session_model = NULL;
-
-SessionsModel *QLightDM::sessions()
-{
- if (!session_model)
- session_model = new SessionsModel ();
-
- return session_model;
-}
-
SessionsModel::SessionsModel(QObject *parent) :
QAbstractListModel(parent),
d(new SessionsModelPrivate())
using namespace QLightDM;
-static UsersModel *user_model = NULL;
-
-UsersModel *QLightDM::users()
-{
- if (!user_model)
- user_model = new UsersModel ();
-
- return user_model;
-}
-
-
class UserItem
{
public: