From: David Faure Date: Mon, 11 Feb 2008 12:44:46 +0000 (+0000) Subject: Forwardport 773570: X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/846b21edf57e7aeb83e84ee68e9f61c5981fbacd Forwardport 773570: Factorize all the view-related action handling to DolphinViewActionHandler, to remove code duplication between mainwindow and part, and to remove my code-splitting with the static createFooAction methods in the view. svn path=/trunk/KDE/kdebase/apps/; revision=773572 --- 846b21edf57e7aeb83e84ee68e9f61c5981fbacd diff --cc src/CMakeLists.txt index deb1b3bb6,b2cdfd582..f5a6c3ed9 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@@ -23,13 -19,15 +23,14 @@@ set(dolphinprivate_LIB_SRC dolphinmodel.cpp dolphinsettings.cpp dolphincategorydrawer.cpp - viewproperties.cpp - dolphinsortfilterproxymodel.cpp - renamedialog.cpp dolphinview.cpp + dolphinviewactionhandler.cpp + iconmanager.cpp ratingpainter.cpp - dolphindropcontroller.cpp + renamedialog.cpp + selectiontoggle.cpp + selectionmanager.cpp + viewproperties.cpp ) kde4_add_kcfg_files(dolphinprivate_LIB_SRCS diff --cc src/dolphinmainwindow.cpp index afabdf983,c1d6cef39..160c423ec --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -58,9 -60,7 +59,8 @@@ #include #include #include +#include #include - #include #include #include #include @@@ -246,26 -224,6 +224,13 @@@ void DolphinMainWindow::slotSortingChan } } - void DolphinMainWindow::slotSortOrderChanged(Qt::SortOrder order) - { - QAction* descending = actionCollection()->action("descending"); - const bool sortDescending = (order == Qt::DescendingOrder); - descending->setChecked(sortDescending); - } - - void DolphinMainWindow::slotAdditionalInfoChanged() - { - DolphinView* view = m_activeViewContainer->view(); - view->updateAdditionalInfoActions(actionCollection()); - } - +void DolphinMainWindow::slotEditableStateChanged(bool editable) +{ + KToggleAction* editableLocationAction = + static_cast(actionCollection()->action("editable_location")); + editableLocationAction->setChecked(editable); +} + void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection) { updateEditActions(); diff --cc src/dolphinmainwindow.h index edc5c1bd6,b1694c323..bddeba7b1 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@@ -305,14 -270,8 +270,8 @@@ private slots */ void toggleFilterBarVisibility(bool show); - /** Increases the size of the current set view mode. */ - void zoomIn(); - - /** Decreases the size of the current set view mode. */ - void zoomOut(); - /** - * Toggles between edit and brose mode of the navigation bar. + * Toggles between edit and browse mode of the navigation bar. */ void toggleEditLocation(); @@@ -361,24 -320,6 +320,9 @@@ /** Updates the state of the 'Sort by' actions. */ void slotSortingChanged(DolphinView::Sorting sorting); - /** Updates the state of the 'Sort Ascending/Descending' action. */ - void slotSortOrderChanged(Qt::SortOrder order); - - /** Updates the state of the 'Additional Information' actions. */ - void slotAdditionalInfoChanged(); - + /** Updates the state of the 'Show Full Location' action. */ + void slotEditableStateChanged(bool editable); + /** * Updates the state of the 'Edit' menu actions and emits * the signal selectionChanged().