on d3d16c8 help sign in
66 lines 1.7 kB history raw
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#include "SessionsModel.h"
18#include "SessionsModelPrivate.h"
20namespace QLightDM
23SessionsModelPrivate::SessionsModelPrivate(SessionsModel* parent)
24 : testScenario("singleSession")
25 , q_ptr(parent)
27 resetEntries();
30void SessionsModelPrivate::resetEntries()
32 Q_Q(SessionsModel);
34 q->beginResetModel();
35 if (testScenario == "multipleSessions") {
36 resetEntries_multipleSessions();
37 } else if (testScenario == "noSessions") {
38 resetEntries_noSessions();
39 } else {
40 resetEntries_singleSession();
41 }
42 q->endResetModel();
45void SessionsModelPrivate::resetEntries_multipleSessions()
47 sessionItems =
48 {
49 {"", "", "Ubuntu", ""},
50 {"", "", "GNOME", ""},
51 {"", "", "Plasma", ""},
52 {"", "", "Unknown?", ""}
53 };
56void SessionsModelPrivate::resetEntries_noSessions()
58 sessionItems = {};
61void SessionsModelPrivate::resetEntries_singleSession()
63 sessionItems = {{"", "", "Ubuntu", ""}};
66} // namespace QLightDM