1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

TabManager: Fix add tab button when grouping type is not window

This commit is contained in:
srazi 2017-04-10 00:30:04 +04:30
parent eb0cf5065d
commit f57d6d0682

View File

@ -218,15 +218,15 @@ void TabManagerWidget::onItemActivated(QTreeWidgetItem* item, int column)
BrowserWindow* mainWindow = qobject_cast<BrowserWindow*>(qvariant_cast<QWidget*>(item->data(0, QupZillaPointerRole)));
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;
}
if (column == 1) {
if (item->childCount() == 0 && tabWidget)
mainWindow->tabWidget()->requestCloseTab(mainWindow->tabWidget()->indexOf(tabWidget));
else if (item->childCount() > 0)
QMetaObject::invokeMethod(mainWindow, "addTab");
if (!mainWindow) {
return;
}