diff options
| author | Peter Penz <[email protected]> | 2007-02-05 23:18:22 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-02-05 23:18:22 +0000 |
| commit | 9eb1cac4b7661ff154c782c9d2933e5a060b2542 (patch) | |
| tree | 5d3e072ac06d1d7799e848636c4ee3d481c6d477 /src/dolphindetailsview.cpp | |
| parent | fe1cb386e4234fcc22efcbbce1c792de24273875 (diff) | |
update the header indicators corresponding to the current sort column and sort order
svn path=/trunk/playground/utils/dolphin/; revision=630675
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index e04ff7618..fc40d9585 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -19,19 +19,32 @@ ***************************************************************************/ #include "dolphindetailsview.h" + +#include <assert.h> #include "dolphinmainwindow.h" #include "dolphinview.h" - +#include "viewproperties.h" #include <QHeaderView> DolphinDetailsView::DolphinDetailsView(DolphinView* parent) : QTreeView(parent), m_parentView(parent) { + assert(parent != 0); + setAcceptDrops(true); setRootIsDecorated(false); setSortingEnabled(true); setUniformRowHeights(true); + + const ViewProperties props(parent->url()); + setSortIndicatorSection(props.sorting()); + setSortIndicatorOrder(props.sortOrder()); + + connect(parent, SIGNAL(sortingChanged(DolphinView::Sorting)), + this, SLOT(setSortIndicatorSection(DolphinView::Sorting))); + connect(parent, SIGNAL(sortOrderChanged(Qt::SortOrder)), + this, SLOT(setSortIndicatorOrder(Qt::SortOrder))); } DolphinDetailsView::~DolphinDetailsView() @@ -107,4 +120,16 @@ void DolphinDetailsView::dropEvent(QDropEvent* event) } } +void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting) +{ + QHeaderView* headerView = header(); + headerView->setSortIndicator(sorting, headerView->sortIndicatorOrder()); +} + +void DolphinDetailsView::setSortIndicatorOrder(Qt::SortOrder sortOrder) +{ + QHeaderView* headerView = header(); + headerView->setSortIndicator(headerView->sortIndicatorSection(), sortOrder); +} + #include "dolphindetailsview.moc" |
