@@ -81,15 +81,16 @@ void UsersModel::setCurrentSessionName(const QString &sessionName, const QString
82 Q_D(UsersModel);
82 Q_D(UsersModel);
84 for (auto &entry : d->entries) {
86 for (auto &entry : d->entries) {
85 if (username == entry.username) {
87 if (username == entry.username) {
86 entry.session = sessionName;
88 entry.session = sessionName;
88− // Since the incides are mangled, there is no easy way to emit dataChanged
89− // and that doesn't matter for the limited use of this function
95int UsersModel::rowCount(const QModelIndex &parent) const
96int UsersModel::rowCount(const QModelIndex &parent) const
@@ -155,28 +156,33 @@ void UsersModel::resetEntries()
155 } else if (userMode == "single-pin") {
156 } else if (userMode == "single-pin") {
156 d->entries = {{"has-pin", "Has PIN", "", 0, false, false, "ubuntu", 0}};
157 d->entries = {{"has-pin", "Has PIN", "", 0, false, false, "ubuntu", 0}};
157 } else if (userMode == "full") {
158 } else if (userMode == "full") {
160+ * Since the real model sorts these entries alphabetically, the model indices
161+ * don't line up correctly. The easiest way to fix this is to ensure that this
162+ * list of entries REMAINS IN ALPHABETICAL ORDER at all times.
158 d->entries = {
164 d->entries = {
165+ { "active", "Active Account", 0, 0, true, false, "ubuntu", 0 },
166+ { "auth-error", "Auth Error", 0, 0, false, false, "ubuntu", 0 },
167+ { "black-background", "Black Background", "#000000", 0, false, false, "ubuntu", 0 },
168+ { "color-background", "Color Background", "#E95420", 0, false, false, "ubuntu", 0 },
169+ { "different-prompt", "Different Prompt", 0, 0, false, false, "ubuntu", 0 },
170+ { "empty-name", "", 0, 0, false, false, "ubuntu", 0 },
159 { "has-password", "Has Password", 0, 0, false, false, "ubuntu", 0 },
171 { "has-password", "Has Password", 0, 0, false, false, "ubuntu", 0 },
160 { "has-pin", "Has PIN", 0, 0, false, false, "ubuntu", 0 },
172 { "has-pin", "Has PIN", 0, 0, false, false, "ubuntu", 0 },
161− { "different-prompt", "Different Prompt", 0, 0, false, false, "ubuntu", 0 },
162− { "no-password", "No Password", 0, 0, false, false, "ubuntu", 0 },
163− { "auth-error", "Auth Error", 0, 0, false, false, "ubuntu", 0 },
164− { "two-factor", "Two Factor", 0, 0, false, false, "ubuntu", 0 },
165− { "info-prompt", "Info Prompt", 0, 0, false, false, "ubuntu", 0 },
166 { "html-info-prompt", "HTML Info Prompt", 0, 0, false, false, "ubuntu", 0 },
173 { "html-info-prompt", "HTML Info Prompt", 0, 0, false, false, "ubuntu", 0 },
174+ { "info-prompt", "Info Prompt", 0, 0, false, false, "ubuntu", 0 },
167 { "long-info-prompt", "Long Info Prompt", 0, 0, false, false, "ubuntu", 0 },
175 { "long-info-prompt", "Long Info Prompt", 0, 0, false, false, "ubuntu", 0 },
168− { "wide-info-prompt", "Wide Info Prompt", 0, 0, false, false, "ubuntu", 0 },
169− { "multi-info-prompt", "Multi Info Prompt", 0, 0, false, false, "ubuntu", 0 },
170 { "long-name", "Long name (far far too long to fit, seriously this would never fit on the screen, you will never see this part of the name)", 0, 0, false, false, "ubuntu", 0 },
176 { "long-name", "Long name (far far too long to fit, seriously this would never fit on the screen, you will never see this part of the name)", 0, 0, false, false, "ubuntu", 0 },
177+ { "multi-info-prompt", "Multi Info Prompt", 0, 0, false, false, "ubuntu", 0 },
171− { "color-background", "Color Background", "#E95420", 0, false, false, "ubuntu", 0 },
178+ { "no-background", "No Background", "", 0, false, false, "ubuntu", 0 },
179+ { "no-password", "No Password", 0, 0, false, false, "ubuntu", 0 },
180+ { "no-response", "No Response", 0, 0, false, false, "ubuntu", 0 },
181+ { "two-factor", "Two Factor", 0, 0, false, false, "ubuntu", 0 },
182+ { "unicode", "가나다라마", 0, 0, false, false, "ubuntu", 0 },
172 // white and black are a bit redundant, but useful for manually testing if UI is still readable
183 // white and black are a bit redundant, but useful for manually testing if UI is still readable
173 { "white-background", "White Background", "#ffffff", 0, false, false, "ubuntu", 0 },
184 { "white-background", "White Background", "#ffffff", 0, false, false, "ubuntu", 0 },
174− { "black-background", "Black Background", "#000000", 0, false, false, "ubuntu", 0 },
175− { "no-background", "No Background", "", 0, false, false, "ubuntu", 0 },
176− { "unicode", "가나다라마", 0, 0, false, false, "ubuntu", 0 },
177− { "no-response", "No Response", 0, 0, false, false, "ubuntu", 0 },
178− { "empty-name", "", 0, 0, false, false, "ubuntu", 0 },
185+ { "wide-info-prompt", "Wide Info Prompt", 0, 0, false, false, "ubuntu", 0 }
179− { "active", "Active Account", 0, 0, true, false, "ubuntu", 0 },