]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Make moving animations less obtrusive
[dolphin.git] / src / dolphinmainwindow.cpp
index 4502e703f8c960e546883c453a25348c468f93c4..3654ed6c969bfb76f41993babc3f9f9182edcc9e 100644 (file)
@@ -41,6 +41,7 @@
 #include "statusbar/dolphinstatusbar.h"
 #include "views/dolphinviewactionhandler.h"
 #include "views/dolphinremoteencoding.h"
+#include "views/draganddrophelper.h"
 #include "views/viewproperties.h"
 
 #ifndef Q_OS_WIN
@@ -510,12 +511,12 @@ void DolphinMainWindow::openNewTab(const KUrl& url)
 
     actionCollection()->action("close_tab")->setEnabled(true);
 
-    // provide a split view, if the startup settings are set this way
+    // Provide a split view, if the startup settings are set this way
     if (GeneralSettings::splitView()) {
         const int newTabIndex = m_viewTab.count() - 1;
         createSecondaryView(newTabIndex);
-        viewTab.secondaryView->setActive(true);
-        viewTab.isPrimaryViewActive = false;
+        m_viewTab[newTabIndex].secondaryView->setActive(true);
+        m_viewTab[newTabIndex].isPrimaryViewActive = false;
     }
 
     if (focusWidget) {
@@ -1327,9 +1328,9 @@ void DolphinMainWindow::tabDropEvent(int tab, QDropEvent* event)
     const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
     if (!urls.isEmpty() && tab != -1) {
         const ViewTab& viewTab = m_viewTab[tab];
-        const KUrl destPath = viewTab.isPrimaryViewActive ? viewTab.primaryView->url() : viewTab.secondaryView->url();
-        Q_UNUSED(destPath);
-        //DragAndDropHelper::instance().dropUrls(KFileItem(), destPath, event, m_tabBar);
+        const DolphinView* view = viewTab.isPrimaryViewActive ? viewTab.primaryView->view()
+                                                              : viewTab.secondaryView->view();
+        DragAndDropHelper::dropUrls(view->rootItem(), event);
     }
 }