┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2024-04-09 05:53:41 +0000
committerMéven Car <[email protected]>2024-04-09 05:53:41 +0000
commit13cf4c096fc673e43a22746342d25c506bde8405 (patch)
tree55b3a1b2fa5cb8d5fb8d56981be21da6d1298a34 /src/views
parent10d3c1e55f42565731c2badeea82b47211a141d8 (diff)
Fix saving sort role after change from header
This is a partial revert of 5186f09cabf0af4b0683e75b0bcde1061f84a67e. That commit tried to simplify code, however this lead to the saving of view properties being skipped, introducing the linked bug. The issue is that by the time the slotSortRoleChangedFromHeader() method is called, the model already changed its sort role. Therefore the check if the new role is identical to the old sort role fails and no saving would occur. With this partial revert the header will continue to change the sort role itself (which allows a minor optimization of not double sorting when also changing the sort order at the same time). The method slotSortRoleChangedFromHeader() is then only responsible for saving that change in the ViewProperties and telling the SortBy menu in the user interface that the sorting has changed. BUG: 480246
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinview.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 32209b9fb..613f99405 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -1936,7 +1936,10 @@ void DolphinView::slotSortRoleChangedByHeader(const QByteArray &current, const Q
Q_UNUSED(previous)
Q_ASSERT(m_model->sortRole() == current);
- setSortRole(current);
+ ViewProperties props(viewPropertiesUrl());
+ props.setSortRole(current);
+
+ Q_EMIT sortRoleChanged(current);
}
void DolphinView::slotVisibleRolesChangedByHeader(const QList<QByteArray> &current, const QList<QByteArray> &previous)