diff options
| author | David Faure <[email protected]> | 2008-02-13 18:07:34 +0000 |
|---|---|---|
| committer | David Faure <[email protected]> | 2008-02-13 18:07:34 +0000 |
| commit | 905277aac40f2a55daa5bb2925acb6d4046dacfd (patch) | |
| tree | 0e71fb7f7a5ba6ab7f0d88edf5fdf01dbb5bd499 /src/dolphinmainwindow.cpp | |
| parent | 35654aa44d35fb238ed2f045617917fa87a7f468 (diff) | |
Provide the dolphinpart view modes (Icons, Details, Columns) in konqueror's View Modes menu.
(this is done using a Q_PROPERTY in the dolphin part and a signal; the available view modes for creating the menu in the first place are listed in dolphinpart.desktop)
Konqueror: cleaned up the old (complex) handling of view modes as N toolbar buttons from M services grouped by library.
Dolphin: moved view mode handling to DolphinViewActionHandler, removes duplication between part and mainwindow.
BUG: 157424
svn path=/branches/KDE/4.0/kdebase/apps/; revision=774632
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index c1d6cef39..f9cf0d2a9 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -177,11 +177,6 @@ void DolphinMainWindow::changeSelection(const KFileItemList& selection) activeViewContainer()->view()->changeSelection(selection); } -void DolphinMainWindow::slotViewModeChanged() -{ - updateViewActions(); -} - void DolphinMainWindow::slotSortingChanged(DolphinView::Sorting sorting) { QAction* action = 0; @@ -475,12 +470,6 @@ void DolphinMainWindow::invertSelection() m_activeViewContainer->view()->invertSelection(); } -void DolphinMainWindow::setViewMode(QAction* action) -{ - const DolphinView::Mode mode = action->data().value<DolphinView::Mode>(); - m_activeViewContainer->view()->setMode(mode); -} - void DolphinMainWindow::sortByName() { m_activeViewContainer->view()->setSorting(DolphinView::SortByName); @@ -836,21 +825,10 @@ void DolphinMainWindow::setupActions() // setup 'View' menu - KToggleAction* iconsView = DolphinView::iconsModeAction(actionCollection()); - KToggleAction* detailsView = DolphinView::detailsModeAction(actionCollection()); - KToggleAction* columnView = DolphinView::columnsModeAction(actionCollection()); - - QActionGroup* viewModeGroup = new QActionGroup(this); - viewModeGroup->addAction(iconsView); - viewModeGroup->addAction(detailsView); - viewModeGroup->addAction(columnView); - connect(viewModeGroup, SIGNAL(triggered(QAction*)), this, SLOT(setViewMode(QAction*))); - + //TODO //QActionGroup* sortActionGroup = DolphinView::createSortActionGroup(actionCollection()); //connect(sortActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(sortActionGroupTriggered(QAction*))); - // TODO use a QActionGroup - KToggleAction* sortByName = actionCollection()->add<KToggleAction>("sort_by_name"); sortByName->setText(i18nc("@action:inmenu Sort By", "Name")); connect(sortByName, SIGNAL(triggered()), this, SLOT(sortByName())); @@ -1120,11 +1098,6 @@ void DolphinMainWindow::updateViewActions() m_actionHandler->updateViewActions(); const DolphinView* view = m_activeViewContainer->view(); - QAction* action = actionCollection()->action(view->currentViewModeActionName()); - if (action != 0) { - action->setChecked(true); - } - slotSortingChanged(view->sorting()); QAction* showFilterBarAction = actionCollection()->action("show_filter_bar"); @@ -1156,8 +1129,6 @@ void DolphinMainWindow::connectViewSignals(int viewIndex) this, SLOT(updateFilterBarAction(bool))); DolphinView* view = container->view(); - connect(view, SIGNAL(modeChanged()), - this, SLOT(slotViewModeChanged())); connect(view, SIGNAL(sortingChanged(DolphinView::Sorting)), this, SLOT(slotSortingChanged(DolphinView::Sorting))); connect(view, SIGNAL(selectionChanged(KFileItemList)), |
