From: Peter Penz Date: Sun, 9 Jan 2011 12:28:43 +0000 (+0000) Subject: Internal simplification: It is not necessary to keep the ViewModeController as member... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/58ea012256a752fb803a462c0ff025a4de4b5dbf Internal simplification: It is not necessary to keep the ViewModeController as member for the view-modes, as the URL is alredy known by the DolphinViewController. svn path=/trunk/KDE/kdebase/apps/; revision=1213172 --- diff --git a/src/views/dolphincolumnview.cpp b/src/views/dolphincolumnview.cpp index 41d281bac..52d86f121 100644 --- a/src/views/dolphincolumnview.cpp +++ b/src/views/dolphincolumnview.cpp @@ -300,7 +300,7 @@ void DolphinColumnView::dropEvent(QDropEvent* event) m_container->m_dolphinViewController->setItemView(this); const QModelIndex dolphinModelIndex = m_proxyModel->mapToSource(index); const KFileItem item = m_dolphinModel->itemForIndex(dolphinModelIndex); - m_container->m_dolphinViewController->indicateDroppedUrls(item, url(), event); + m_container->m_dolphinViewController->indicateDroppedUrls(item, event); DolphinTreeView::dropEvent(event); } diff --git a/src/views/dolphindetailsview.cpp b/src/views/dolphindetailsview.cpp index 12a2ba348..d825153f3 100644 --- a/src/views/dolphindetailsview.cpp +++ b/src/views/dolphindetailsview.cpp @@ -52,7 +52,6 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinTreeView(parent), m_autoResize(true), m_dolphinViewController(dolphinViewController), - m_viewModeController(viewModeController), m_extensionsFactory(0), m_expandableFoldersAction(0), m_expandedUrls(), @@ -239,7 +238,7 @@ void DolphinDetailsView::dropEvent(QDropEvent* event) if (index.isValid() && (index.column() == DolphinModel::Name)) { item = m_dolphinViewController->itemForIndex(index); } - m_dolphinViewController->indicateDroppedUrls(item, m_viewModeController->url(), event); + m_dolphinViewController->indicateDroppedUrls(item, event); DolphinTreeView::dropEvent(event); } diff --git a/src/views/dolphindetailsview.h b/src/views/dolphindetailsview.h index fddbdc6c0..640181274 100644 --- a/src/views/dolphindetailsview.h +++ b/src/views/dolphindetailsview.h @@ -199,7 +199,6 @@ private: bool m_autoResize; // if true, the columns are resized automatically to the available width DolphinViewController* m_dolphinViewController; - const ViewModeController* m_viewModeController; ViewExtensionsFactory* m_extensionsFactory; QAction* m_expandableFoldersAction; diff --git a/src/views/dolphiniconsview.cpp b/src/views/dolphiniconsview.cpp index 4abcad3db..f04769762 100644 --- a/src/views/dolphiniconsview.cpp +++ b/src/views/dolphiniconsview.cpp @@ -45,7 +45,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinSortFilterProxyModel* proxyModel) : KCategorizedView(parent), m_dolphinViewController(dolphinViewController), - m_viewModeController(viewModeController), m_categoryDrawer(new DolphinCategoryDrawer(this)), m_extensionsFactory(0), m_font(), @@ -224,7 +223,7 @@ void DolphinIconsView::dropEvent(QDropEvent* event) { const QModelIndex index = indexAt(event->pos()); const KFileItem item = m_dolphinViewController->itemForIndex(index); - m_dolphinViewController->indicateDroppedUrls(item, m_viewModeController->url(), event); + m_dolphinViewController->indicateDroppedUrls(item, event); // don't call KCategorizedView::dropEvent(event), as it moves // the items which is not wanted } diff --git a/src/views/dolphiniconsview.h b/src/views/dolphiniconsview.h index 21e37ba02..0f6f716c3 100644 --- a/src/views/dolphiniconsview.h +++ b/src/views/dolphiniconsview.h @@ -106,7 +106,6 @@ private: private: DolphinViewController* m_dolphinViewController; - const ViewModeController* m_viewModeController; DolphinCategoryDrawer* m_categoryDrawer; ViewExtensionsFactory* m_extensionsFactory; diff --git a/src/views/dolphinviewcontroller.cpp b/src/views/dolphinviewcontroller.cpp index 6e2570007..6749eaa41 100644 --- a/src/views/dolphinviewcontroller.cpp +++ b/src/views/dolphinviewcontroller.cpp @@ -84,11 +84,9 @@ void DolphinViewController::requestActivation() emit activated(); } -void DolphinViewController::indicateDroppedUrls(const KFileItem& destItem, - const KUrl& destPath, - QDropEvent* event) +void DolphinViewController::indicateDroppedUrls(const KFileItem& destItem, QDropEvent* event) { - emit urlsDropped(destItem, destPath, event); + emit urlsDropped(destItem, m_dolphinView->url(), event); } diff --git a/src/views/dolphinviewcontroller.h b/src/views/dolphinviewcontroller.h index ea0027928..07bc56936 100644 --- a/src/views/dolphinviewcontroller.h +++ b/src/views/dolphinviewcontroller.h @@ -87,12 +87,9 @@ public: * Indicates that URLs are dropped above a destination. The DolphinView * will start the corresponding action (copy, move, link). * @param destItem Item of the destination (can be null, see KFileItem::isNull()). - * @param destPath Path of the destination. * @param event Drop event */ - void indicateDroppedUrls(const KFileItem& destItem, - const KUrl& destPath, - QDropEvent* event); + void indicateDroppedUrls(const KFileItem& destItem, QDropEvent* event); /** * Informs the DolphinView about a sorting change done inside