Sort the session list alphabetically.

Task-Nr: 257986
This commit is contained in:
dt
2009-07-21 13:17:58 +02:00
parent 9e2f12c737
commit 9d58ea3e7c
2 changed files with 18 additions and 4 deletions

View File

@@ -164,8 +164,10 @@ void SessionDialog::createNew()
return;
m_sessionManager->createSession(newSession);
m_ui.sessionList->addItem(newSession);
m_ui.sessionList->setCurrentRow(m_ui.sessionList->count() - 1);
m_ui.sessionList->clear();
QStringList sessions = m_sessionManager->sessions();
m_ui.sessionList->addItems(sessions);
m_ui.sessionList->setCurrentRow(sessions.indexOf(newSession));
}
}
@@ -174,8 +176,12 @@ void SessionDialog::clone()
NewSessionInputDialog newSessionInputDialog(m_sessionManager->sessions());
if (newSessionInputDialog.exec() == QDialog::Accepted) {
QString newSession = newSessionInputDialog.value();
if (m_sessionManager->cloneSession(m_ui.sessionList->currentItem()->text(), newSession))
m_ui.sessionList->addItem(newSession);
if (m_sessionManager->cloneSession(m_ui.sessionList->currentItem()->text(), newSession)) {
m_ui.sessionList->clear();
QStringList sessions = m_sessionManager->sessions();
m_ui.sessionList->addItems(sessions);
m_ui.sessionList->setCurrentRow(sessions.indexOf(newSession));
}
}
}