on 01c8faa help sign in
73 lines 2.1 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", "", "Ubuntu", ""},
50 {"ubuntu-2d", "", "Ubuntu 2D", ""},
51 {"gnome", "", "GNOME", ""},
52 {"gnome-classic", "", "GNOME Classic", ""},
53 {"gnome-flashback-compiz", "", "GNOME Flashback (Compiz)", ""},
54 {"gnome-flashback-metacity", "", "GNOME Flashback (Metacity)", ""},
55 {"gnome-wayland", "", "GNOME on Wayland", ""},
56 {"plasma", "", "Plasma", ""},
57 {"kde", "", "KDE" , ""},
58 {"xterm", "", "Recovery Console", ""},
59 {"", "", "Unknown?", ""}
60 };
63void SessionsModelPrivate::resetEntries_noSessions()
65 sessionItems = {};
68void SessionsModelPrivate::resetEntries_singleSession()
70 sessionItems = {{"ubuntu", "", "Ubuntu", ""}};
73} // namespace QLightDM