refactor sessiondialog a bit

- made code more local by moving clicked slot to lambda
 - use class initializations
 - move default value inside the constructor to reduce arguments

Change-Id: I98735a0b4c69ea538ed1af6133ef1054039a1b11
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Tim Jenssen
2017-05-29 13:45:19 +02:00
parent 76185b3b09
commit 89639b0bf3
3 changed files with 11 additions and 17 deletions

View File

@@ -224,7 +224,7 @@ void SessionModel::switchToSession(const QString &session)
void SessionModel::runNewSessionDialog(const QString &suggestedName, std::function<void(const QString &)> createSession)
{
SessionNameInputDialog newSessionInputDialog(SessionManager::sessions(), nullptr);
SessionNameInputDialog newSessionInputDialog;
newSessionInputDialog.setWindowTitle(tr("New Session Name"));
newSessionInputDialog.setValue(suggestedName);