mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Add DolphinTabPage::inactiveViewContainer()
This commit is contained in:
parent
78a3cd3e4b
commit
215923b33f
|
@ -164,6 +164,15 @@ DolphinViewContainer *DolphinTabPage::activeViewContainer() const
|
||||||
return m_primaryViewActive ? m_primaryViewContainer : m_secondaryViewContainer;
|
return m_primaryViewActive ? m_primaryViewContainer : m_secondaryViewContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DolphinViewContainer *DolphinTabPage::inactiveViewContainer() const
|
||||||
|
{
|
||||||
|
if (!splitViewEnabled()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return primaryViewActive() ? secondaryViewContainer() : primaryViewContainer();
|
||||||
|
}
|
||||||
|
|
||||||
KFileItemList DolphinTabPage::selectedItems() const
|
KFileItemList DolphinTabPage::selectedItems() const
|
||||||
{
|
{
|
||||||
KFileItemList items = m_primaryViewContainer->view()->selectedItems();
|
KFileItemList items = m_primaryViewContainer->view()->selectedItems();
|
||||||
|
|
|
@ -66,6 +66,12 @@ public:
|
||||||
*/
|
*/
|
||||||
DolphinViewContainer *activeViewContainer() const;
|
DolphinViewContainer *activeViewContainer() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DolphinViewContainer of the inactive view
|
||||||
|
* if split view is enabled, or nullptr otherwise.
|
||||||
|
*/
|
||||||
|
DolphinViewContainer *inactiveViewContainer() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the selected items. The list is empty if no item has been
|
* Returns the selected items. The list is empty if no item has been
|
||||||
* selected.
|
* selected.
|
||||||
|
|
|
@ -335,12 +335,7 @@ void DolphinTabWidget::copyToInactiveSplitView()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DolphinView *inactiveView;
|
DolphinView *const inactiveView = tabPage->inactiveViewContainer()->view();
|
||||||
if (tabPage->primaryViewActive()) {
|
|
||||||
inactiveView = tabPage->secondaryViewContainer()->view();
|
|
||||||
} else {
|
|
||||||
inactiveView = tabPage->primaryViewContainer()->view();
|
|
||||||
}
|
|
||||||
inactiveView->copySelectedItems(selectedItems, inactiveView->url());
|
inactiveView->copySelectedItems(selectedItems, inactiveView->url());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,12 +351,7 @@ void DolphinTabWidget::moveToInactiveSplitView()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DolphinView *inactiveView;
|
DolphinView *const inactiveView = tabPage->inactiveViewContainer()->view();
|
||||||
if (tabPage->primaryViewActive()) {
|
|
||||||
inactiveView = tabPage->secondaryViewContainer()->view();
|
|
||||||
} else {
|
|
||||||
inactiveView = tabPage->primaryViewContainer()->view();
|
|
||||||
}
|
|
||||||
inactiveView->moveSelectedItems(selectedItems, inactiveView->url());
|
inactiveView->moveSelectedItems(selectedItems, inactiveView->url());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue