diff options
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/sessionmodel.cpp | 4 | ||||
-rw-r--r-- | src/plugins/projectexplorer/sessionmodel.h | 2 |
2 files changed, 6 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); diff --git a/src/plugins/projectexplorer/sessionmodel.h b/src/plugins/projectexplorer/sessionmodel.h index a4c09132f8..d95102590c 100644 --- a/src/plugins/projectexplorer/sessionmodel.h +++ b/src/plugins/projectexplorer/sessionmodel.h @@ -81,6 +81,8 @@ private: void runSessionNameInputDialog(ProjectExplorer::Internal::SessionNameInputDialog *sessionInputDialog, std::function<void(const QString &)> createSession); QStringList m_sortedSessions; + int m_currentSortColumn = 0; + Qt::SortOrder m_currentSortOrder = Qt::AscendingOrder; }; } // namespace Internal |