X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/de9a05966e951257b1f49b7020df8e45052a991a..bbae04bc4efae2825173068dc3bbd3da1afa972e:/src/dolphintabwidget.cpp diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index fba6fe084..7a431152e 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -320,6 +320,40 @@ void DolphinTabWidget::restoreClosedTab(const QByteArray& state) currentTabPage()->restoreState(state); } +void DolphinTabWidget::copyToInactiveSplitView() +{ + const DolphinTabPage* tabPage = tabPageAt(currentIndex()); + DolphinViewContainer* activeViewContainer = currentTabPage()->activeViewContainer(); + if (!tabPage->splitViewEnabled() || activeViewContainer->view()->selectedItems().isEmpty()) { + return; + } + + if (tabPage->primaryViewActive()) { + // copy from left panel to right + activeViewContainer->view()->copySelectedItems(activeViewContainer->view()->selectedItems(), tabPage->secondaryViewContainer()->url()); + } else { + // copy from right panel to left + activeViewContainer->view()->copySelectedItems(activeViewContainer->view()->selectedItems(), tabPage->primaryViewContainer()->url()); + } +} + +void DolphinTabWidget::moveToInactiveSplitView() +{ + const DolphinTabPage* tabPage = tabPageAt(currentIndex()); + DolphinViewContainer* activeViewContainer = currentTabPage()->activeViewContainer(); + if (!tabPage->splitViewEnabled() || activeViewContainer->view()->selectedItems().isEmpty()) { + return; + } + + if (tabPage->primaryViewActive()) { + // move from left panel to right + activeViewContainer->view()->moveSelectedItems(activeViewContainer->view()->selectedItems(), tabPage->secondaryViewContainer()->url()); + } else { + // move from right panel to left + activeViewContainer->view()->moveSelectedItems(activeViewContainer->view()->selectedItems(), tabPage->primaryViewContainer()->url()); + } +} + void DolphinTabWidget::detachTab(int index) { Q_ASSERT(index >= 0);