┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-02-07 06:19:06 +0000
committerPeter Penz <[email protected]>2007-02-07 06:19:06 +0000
commitabf8f1917d1ef044cf732eb873ce28bf805f27af (patch)
treeed3f3fb25887d849b7d792f7a0f4b166f7681631 /src/dolphindetailsview.cpp
parentac62df5672f67393bd582edefaeccb0eb89537e8 (diff)
Additionally to sorting by name, size and date it is now possible to sort by permissions, owner and group.
svn path=/trunk/playground/utils/dolphin/; revision=631058
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp39
1 files changed, 14 insertions, 25 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index f434936dc..24692b5a8 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -21,6 +21,7 @@
#include "dolphindetailsview.h"
#include "dolphinmainwindow.h"
+#include "dolphinsortfilterproxymodel.h"
#include "dolphinview.h"
#include "viewproperties.h"
@@ -142,33 +143,21 @@ void DolphinDetailsView::synchronizeSortingState(int column)
// The sorting has already been changed in QTreeView if this slot is
// invoked, but Dolphin was not informed about this. This is bypassed by changing
// the sorting and sort order to a temporary other value and readjust it again.
- const bool update = (column == KDirModel::Name) || (column == KDirModel::Size) ||
- (column == KDirModel::ModifiedTime);
- if (update) {
- DolphinView::Sorting sorting = DolphinView::SortByName;
- switch (column) {
- case KDirModel::Size: sorting = DolphinView::SortBySize; break;
- case KDirModel::ModifiedTime: sorting = DolphinView::SortByDate; break;
- case KDirModel::Name:
- default: break;
- }
+ DolphinView::Sorting sorting = DolphinSortFilterProxyModel::sortingForColumn(column);
+ const Qt::SortOrder sortOrder = header()->sortIndicatorOrder();
- const Qt::SortOrder sortOrder = header()->sortIndicatorOrder();
-
- // temporary adjust the sorting and sort order to different values...
- const DolphinView::Sorting tempSorting = (sorting == DolphinView::SortByName) ?
- DolphinView::SortBySize :
- DolphinView::SortByName;
- m_dolphinView->setSorting(tempSorting);
- const Qt::SortOrder tempSortOrder = (sortOrder == Qt::Ascending) ?
- Qt::Descending : Qt::Ascending;
- m_dolphinView->setSortOrder(tempSortOrder);
-
- // ... so that setting them again results in storing the new setting.
- m_dolphinView->setSorting(sorting);
- m_dolphinView->setSortOrder(sortOrder);
- }
+ // temporary adjust the sorting and sort order to different values...
+ const DolphinView::Sorting tempSorting = (sorting == DolphinView::SortByName) ?
+ DolphinView::SortBySize :
+ DolphinView::SortByName;
+ m_dolphinView->setSorting(tempSorting);
+ const Qt::SortOrder tempSortOrder = (sortOrder == Qt::Ascending) ?
+ Qt::Descending : Qt::Ascending;
+ m_dolphinView->setSortOrder(tempSortOrder);
+ // ... so that setting them again results in storing the new setting.
+ m_dolphinView->setSorting(sorting);
+ m_dolphinView->setSortOrder(sortOrder);
}
#include "dolphindetailsview.moc"