]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphintabwidget.cpp
Update README.md: fixed typo in subheading (upper case)
[dolphin.git] / src / dolphintabwidget.cpp
index fba6fe084992dc50a7b20f8ce21d984b2afc4bc3..7a431152ed61a5f46ca4a99caef6359bd3978993 100644 (file)
@@ -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);