mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-14 02:52:12 +01:00
TabManager: Fix add tab button when grouping type is not window
This commit is contained in:
parent
eb0cf5065d
commit
f57d6d0682
|
@ -218,15 +218,15 @@ void TabManagerWidget::onItemActivated(QTreeWidgetItem* item, int column)
|
||||||
BrowserWindow* mainWindow = qobject_cast<BrowserWindow*>(qvariant_cast<QWidget*>(item->data(0, QupZillaPointerRole)));
|
BrowserWindow* mainWindow = qobject_cast<BrowserWindow*>(qvariant_cast<QWidget*>(item->data(0, QupZillaPointerRole)));
|
||||||
QWidget* tabWidget = qvariant_cast<QWidget*>(item->data(0, WebTabPointerRole));
|
QWidget* tabWidget = qvariant_cast<QWidget*>(item->data(0, WebTabPointerRole));
|
||||||
|
|
||||||
if (!mainWindow) {
|
if (column == 1) {
|
||||||
|
if (item->childCount() > 0)
|
||||||
|
QMetaObject::invokeMethod(mainWindow ? mainWindow : mApp->getWindow(), "addTab");
|
||||||
|
else if (tabWidget && mainWindow)
|
||||||
|
mainWindow->tabWidget()->requestCloseTab(mainWindow->tabWidget()->indexOf(tabWidget));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (column == 1) {
|
if (!mainWindow) {
|
||||||
if (item->childCount() == 0 && tabWidget)
|
|
||||||
mainWindow->tabWidget()->requestCloseTab(mainWindow->tabWidget()->indexOf(tabWidget));
|
|
||||||
else if (item->childCount() > 0)
|
|
||||||
QMetaObject::invokeMethod(mainWindow, "addTab");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user