aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/sessionmodel.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-05-13 11:47:38 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-05-13 12:48:04 +0000
commit2c5d6de9b4cdd8fda1a0c9245a389e13d56d638f (patch)
tree6f4107178eddf36e3d47cdd488b99a5e81f430cb /src/plugins/projectexplorer/sessionmodel.cpp
parent689fac8fe9cc245a957db78d4ff8d8f12515f687 (diff)
ProjectExplorer: Ensure that the session model stays sorted
Fixes: QTCREATORBUG-23996 Change-Id: I96c8c1b780f5b56cb064146de3de6a4c90f9147a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/sessionmodel.cpp')
-rw-r--r--src/plugins/projectexplorer/sessionmodel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/sessionmodel.cpp b/src/plugins/projectexplorer/sessionmodel.cpp
index a535294f91..5ba79dbf80 100644
--- a/src/plugins/projectexplorer/sessionmodel.cpp
+++ b/src/plugins/projectexplorer/sessionmodel.cpp
@@ -192,6 +192,8 @@ void SessionModel::sort(int column, Qt::SortOrder order)
return isLess;
};
Utils::sort(m_sortedSessions, cmp);
+ m_currentSortColumn = column;
+ m_currentSortOrder = order;
endResetModel();
}
@@ -237,6 +239,7 @@ void SessionModel::deleteSessions(const QStringList &sessions)
beginResetModel();
SessionManager::deleteSessions(sessions);
m_sortedSessions = SessionManager::sessions();
+ sort(m_currentSortColumn, m_currentSortOrder);
endResetModel();
}
@@ -268,6 +271,7 @@ void SessionModel::runSessionNameInputDialog(SessionNameInputDialog *sessionInpu
createSession(newSession);
m_sortedSessions = SessionManager::sessions();
endResetModel();
+ sort(m_currentSortColumn, m_currentSortOrder);
if (sessionInputDialog->isSwitchToRequested())
switchToSession(newSession);