mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +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;
|
||||
}
|
||||
|
||||
DolphinViewContainer *DolphinTabPage::inactiveViewContainer() const
|
||||
{
|
||||
if (!splitViewEnabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return primaryViewActive() ? secondaryViewContainer() : primaryViewContainer();
|
||||
}
|
||||
|
||||
KFileItemList DolphinTabPage::selectedItems() const
|
||||
{
|
||||
KFileItemList items = m_primaryViewContainer->view()->selectedItems();
|
||||
|
|
|
@ -66,6 +66,12 @@ public:
|
|||
*/
|
||||
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
|
||||
* selected.
|
||||
|
|
|
@ -335,12 +335,7 @@ void DolphinTabWidget::copyToInactiveSplitView()
|
|||
return;
|
||||
}
|
||||
|
||||
DolphinView *inactiveView;
|
||||
if (tabPage->primaryViewActive()) {
|
||||
inactiveView = tabPage->secondaryViewContainer()->view();
|
||||
} else {
|
||||
inactiveView = tabPage->primaryViewContainer()->view();
|
||||
}
|
||||
DolphinView *const inactiveView = tabPage->inactiveViewContainer()->view();
|
||||
inactiveView->copySelectedItems(selectedItems, inactiveView->url());
|
||||
}
|
||||
|
||||
|
@ -356,12 +351,7 @@ void DolphinTabWidget::moveToInactiveSplitView()
|
|||
return;
|
||||
}
|
||||
|
||||
DolphinView *inactiveView;
|
||||
if (tabPage->primaryViewActive()) {
|
||||
inactiveView = tabPage->secondaryViewContainer()->view();
|
||||
} else {
|
||||
inactiveView = tabPage->primaryViewContainer()->view();
|
||||
}
|
||||
DolphinView *const inactiveView = tabPage->inactiveViewContainer()->view();
|
||||
inactiveView->moveSelectedItems(selectedItems, inactiveView->url());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue