Commit 919076fa authored by Stefano Crocco's avatar Stefano Crocco
Browse files

Restore ability to close tab by clicking on close button

Summary:
After making KTabBar and KTabWidget part of Konqueror, clicking on the close
button of a tab didn't make the tab close any longer. This fixes it

Test Plan:
Open several tabs in Konqueror, then click on their close button and
check that they close. Check that when only one tab remains, the tab bar is
hidden

Reviewers: dfaure

Reviewed By: dfaure

Differential Revision: https://phabricator.kde.org/D25662
parent 7e9c2dc3
......@@ -83,7 +83,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget *parent, KonqFrameContainerBase *parentCont
if (KonqSettings::tabPosition() == QLatin1String("Bottom")) {
setTabPosition(QTabWidget::South);
}
connect(this, SIGNAL(closeRequest(QWidget*)), SLOT(slotCloseRequest(QWidget*)));
connect(this, &KonqFrameTabs::tabCloseRequested, this, &KonqFrameTabs::slotCloseRequest);
connect(this, SIGNAL(removeTabPopup()),
m_pViewManager->mainWindow(), SLOT(slotRemoveTabPopup()));
......@@ -352,9 +352,9 @@ void KonqFrameTabs::refreshSubPopupMenuTab()
m_pViewManager->mainWindow()->action("removeothertabs")->shortcut());
}
void KonqFrameTabs::slotCloseRequest(QWidget *w)
void KonqFrameTabs::slotCloseRequest(int idx)
{
m_pViewManager->mainWindow()->setWorkingTab(indexOf(w));
m_pViewManager->mainWindow()->setWorkingTab(idx);
emit removeTabPopup();
}
......@@ -614,7 +614,7 @@ bool KonqFrameTabs::eventFilter(QObject *watched, QEvent *event)
if (e->button() == Qt::MidButton) {
if (event->type() == QEvent::MouseButtonRelease) {
const int index = bar->tabAt(e->pos());
slotCloseRequest(widget(index));
slotCloseRequest(index);
}
e->accept();
return true;
......
......@@ -138,7 +138,7 @@ private:
private Q_SLOTS:
void slotContextMenu(const QPoint &);
void slotContextMenu(QWidget *, const QPoint &);
void slotCloseRequest(QWidget *);
void slotCloseRequest(int);
void slotMovedTab(int, int);
void slotMouseMiddleClick();
void slotMouseMiddleClick(QWidget *);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment