┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-03-24 23:46:44 +0100
committerPeter Penz <[email protected]>2012-03-24 23:47:42 +0100
commit1cbe55b97c3b8fd9265ad6b40ce6cc169d4451c1 (patch)
tree24d4017240ee701701d13d9c20bc4cc78e9bb3cb /src/views/dolphinview.cpp
parent3f88f79f862a570b68fe64781955cf7d14124127 (diff)
Cleanup and minor fixes for column-handling
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 241f24fd4..8672b531b 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -830,18 +830,16 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
QAction* action = menu->exec(pos.toPoint());
if (menu && action) {
+ KItemListHeader* header = view->header();
+
if (action == autoAdjustWidthsAction) {
// Clear the column-widths from the viewproperties and turn on
// the automatic resizing of the columns
props.setHeaderColumnWidths(QList<int>());
- KItemListHeader* header = m_container->controller()->view()->header();
header->setAutomaticColumnResizing(true);
} else if (action == customWidthsAction) {
// Apply the current column-widths as custom column-widths and turn
// off the automatic resizing of the columns
- const KItemListView* view = m_container->controller()->view();
- KItemListHeader* header = view->header();
-
QList<int> columnWidths;
foreach (const QByteArray& role, view->visibleRoles()) {
columnWidths.append(header->columnWidth(role));
@@ -862,6 +860,11 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
view->setVisibleRoles(visibleRoles);
props.setVisibleRoles(visibleRoles);
+
+ // Reset the stored column-widths, so that automatic resizing is
+ // used again.
+ props.setHeaderColumnWidths(QList<int>());
+ header->setAutomaticColumnResizing(true);
}
}