Changeset View
Changeset View
Standalone View
Standalone View
components/sessionsprivate/sessionsmodel.cpp
Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | |||||
246 | { | 246 | { | ||
247 | if (index.row() < 0 || index.row() > rowCount(QModelIndex())) { | 247 | if (index.row() < 0 || index.row() > rowCount(QModelIndex())) { | ||
248 | return QVariant(); | 248 | return QVariant(); | ||
249 | } | 249 | } | ||
250 | 250 | | |||
251 | if (index.row() == m_data.count()) { | 251 | if (index.row() == m_data.count()) { | ||
252 | switch (static_cast<Role>(role)) { | 252 | switch (static_cast<Role>(role)) { | ||
253 | case Role::RealName: return i18n("New Session"); | 253 | case Role::RealName: return i18n("New Session"); | ||
254 | case Role::IconName: return QStringLiteral("list-add"); | 254 | case Role::IconName: return QStringLiteral("system-switch-user"); | ||
255 | case Role::Name: return i18n("New Session"); | 255 | case Role::Name: return i18n("New Session"); | ||
256 | case Role::DisplayNumber: return 0; //NA | 256 | case Role::DisplayNumber: return 0; //NA | ||
257 | case Role::VtNumber: return -1; //an invalid VtNumber - which we'll use to indicate it's to start a new session | 257 | case Role::VtNumber: return -1; //an invalid VtNumber - which we'll use to indicate it's to start a new session | ||
258 | case Role::Session: return 0; //NA | 258 | case Role::Session: return 0; //NA | ||
259 | case Role::IsTty: return false; //NA | 259 | case Role::IsTty: return false; //NA | ||
260 | default: return QVariant(); | 260 | default: return QVariant(); | ||
261 | } | 261 | } | ||
262 | } | 262 | } | ||
Show All 35 Lines |