2 * Copyright (C) 2015 Canonical, Ltd.
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.
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.
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/>.
17#include "SessionsModel.h"
18#include "SessionsModelPrivate.h"
23SessionsModelPrivate::SessionsModelPrivate(SessionsModel* parent)
24 : testScenario("singleSession")
26 , m_availableSessions(
28 {"ubuntu", "", "Ubuntu", ""},
29 {"ubuntu-2d", "", "Ubuntu 2D", ""},
30 {"gnome", "", "GNOME", ""},
31 {"gnome-classic", "", "GNOME Classic", ""},
32 {"gnome-flashback-compiz", "", "GNOME Flashback (Compiz)", ""},
33 {"gnome-flashback-metacity", "", "GNOME Flashback (Metacity)", ""},
34 {"gnome-wayland", "", "GNOME on Wayland", ""},
35 {"plasma", "", "Plasma", ""},
36 {"kde", "", "KDE" , ""},
37 {"xterm", "", "Recovery Console", ""},
38 {"", "", "Unknown?", ""}
41 numSessions = numAvailableSessions();
45int SessionsModelPrivate::numAvailableSessions() const
47 return m_availableSessions.length();
50void SessionsModelPrivate::resetEntries()
55 if (testScenario == "multipleSessions") {
56 resetEntries_multipleSessions(numSessions);
57 } else if (testScenario == "noSessions") {
58 resetEntries_noSessions();
60 resetEntries_singleSession();
65void SessionsModelPrivate::resetEntries_multipleSessions(int numSessions)
68 for (int i = 0; i < numSessions; i++) {
69 sessionItems.append(m_availableSessions.value(i));
73void SessionsModelPrivate::resetEntries_noSessions()
78void SessionsModelPrivate::resetEntries_singleSession()
80 sessionItems = {{"ubuntu", "", "Ubuntu", ""}};
83} // namespace QLightDM
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list