From 283f97ac27c3cfe5c72682b0843503e31643a612 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 15 Oct 2011 22:55:01 +0200 Subject: Interface cleanups to prepare the return of "grouped sorting" - Rename setCategorizedSorting() to setGroupedSorting() - Change the model interface to allow enabling/disabling grouping without the need to declare a role (the sort role will be taken). - Add dummy group role implementation in KFileItemModel The grouping code itself requires some cleanups and might crash at the moment or lead to weird layouts. --- src/views/dolphinviewactionhandler.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/views/dolphinviewactionhandler.cpp') diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index cdc9646c6..f765b4a09 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -70,7 +70,7 @@ void DolphinViewActionHandler::setCurrentView(DolphinView* view) this, SLOT(slotAdditionalInfoListChanged(QList, QList))); connect(view, SIGNAL(categorizedSortingChanged(bool)), - this, SLOT(slotCategorizedSortingChanged(bool))); + this, SLOT(slotGroupedSortingChanged(bool))); connect(view, SIGNAL(hiddenFilesShownChanged(bool)), this, SLOT(slotHiddenFilesShownChanged(bool))); connect(view, SIGNAL(sortingChanged(DolphinView::Sorting)), @@ -196,7 +196,7 @@ void DolphinViewActionHandler::createActions() KToggleAction* showInGroups = m_actionCollection->add("show_in_groups"); showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups")); - connect(showInGroups, SIGNAL(triggered(bool)), this, SLOT(toggleSortCategorization(bool))); + connect(showInGroups, SIGNAL(triggered(bool)), this, SLOT(toggleGroupedSorting(bool))); KToggleAction* showHiddenFiles = m_actionCollection->add("show_hidden_files"); showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files")); @@ -339,7 +339,7 @@ void DolphinViewActionHandler::updateViewActions() slotSortOrderChanged(m_currentView->sortOrder()); slotSortFoldersFirstChanged(m_currentView->sortFoldersFirst()); slotAdditionalInfoListChanged(m_currentView->additionalInfoList(), QList()); - slotCategorizedSortingChanged(m_currentView->categorizedSorting()); + slotGroupedSortingChanged(m_currentView->groupedSorting()); slotSortingChanged(m_currentView->sorting()); slotZoomLevelChanged(m_currentView->zoomLevel(), -1); @@ -428,15 +428,15 @@ void DolphinViewActionHandler::slotAdditionalInfoListChanged(const QListsetCategorizedSorting(categorizedSorting); + m_currentView->setGroupedSorting(grouped); } -void DolphinViewActionHandler::slotCategorizedSortingChanged(bool sortCategorized) +void DolphinViewActionHandler::slotGroupedSortingChanged(bool groupedSorting) { QAction* showInGroupsAction = m_actionCollection->action("show_in_groups"); - showInGroupsAction->setChecked(sortCategorized); + showInGroupsAction->setChecked(groupedSorting); } void DolphinViewActionHandler::toggleShowHiddenFiles(bool show) @@ -451,7 +451,6 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown) showHiddenFilesAction->setChecked(shown); } - KToggleAction* DolphinViewActionHandler::iconsModeAction() { KToggleAction* iconsView = m_actionCollection->add("icons"); -- cgit v1.3