mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
WebTab: Fix removing from existing parent in addChildTab
This commit is contained in:
parent
1c7288204c
commit
4bb75de25c
|
@ -71,6 +71,10 @@ void WebTabTest::parentChildTabsTest()
|
|||
QCOMPARE(tab3.childTabs(), QVector<WebTab*>{&tab4});
|
||||
QCOMPARE(tab4.parentTab(), &tab3);
|
||||
|
||||
tab3.addChildTab(&tab2);
|
||||
QCOMPARE(tab3.childTabs(), (QVector<WebTab*>{&tab4, &tab2}));
|
||||
QCOMPARE(tab1.childTabs(), (QVector<WebTab*>{&tab3, &tab5, &tab6}));
|
||||
|
||||
QTest::qWait(10);
|
||||
}
|
||||
|
||||
|
|
|
@ -446,9 +446,8 @@ void WebTab::addChildTab(WebTab *tab, int index)
|
|||
return;
|
||||
}
|
||||
|
||||
tab->m_parentTab = this;
|
||||
|
||||
WebTab *tabParent = tab->m_parentTab;
|
||||
tab->m_parentTab = this;
|
||||
if (tabParent) {
|
||||
const int index = tabParent->m_childTabs.indexOf(tab);
|
||||
if (index >= 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user