[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:25:12 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=b6d0a81
The following commit has been merged in the master branch:
commit b6d0a81e62bcad031457a6ea28cd15f43da71afc
Author: Martin Klapetek <mklapetek at kde.org>
Date: Wed Jan 14 19:07:04 2015 +0100
[app] Fix broken tabs closing
The signal from KTabWidget used for that is not available in QTabWidget,
needs to be using different signal
---
app/chat-window.cpp | 16 +++++++---------
app/chat-window.h | 2 +-
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 31f485b..893df45 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -132,7 +132,7 @@ ChatWindow::ChatWindow()
m_tabWidget->tabBar()->hide();
m_tabWidget->setElideMode(Qt::ElideRight);
- connect(m_tabWidget, SIGNAL(closeRequest(QWidget*)), this, SLOT(destroyTab(QWidget*)));
+ connect(m_tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(destroyTab(int)));
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onCurrentIndexChanged(int)));
connect(qobject_cast<QTabBar*>(m_tabWidget->tabBar()), SIGNAL(mouseMiddleClick(int)), this, SLOT(onTabMiddleClicked(int)));
@@ -184,7 +184,7 @@ void ChatWindow::tabBarContextMenu(int index, const QPoint& globalPos)
QAction *result = qobject_cast<QAction*>(menu->exec(globalPos));
if(result == &close) {
- destroyTab(m_tabWidget->widget(index));
+ destroyTab(index);
} else if (result == &dettach) {
Q_EMIT detachRequested(qobject_cast<ChatTab*>(m_tabWidget->widget(index)));
} else if (result == &moveLeft) {
@@ -255,9 +255,7 @@ void ChatWindow::removeTab(ChatTab *tab)
void ChatWindow::onTabMiddleClicked(int index)
{
- QWidget *tab = m_tabWidget->widget(index);
- Q_ASSERT(tab);
- destroyTab(tab);
+ destroyTab(index);
}
void ChatWindow::addTab(ChatTab *tab)
@@ -285,13 +283,13 @@ void ChatWindow::addTab(ChatTab *tab)
}
}
-void ChatWindow::destroyTab(QWidget* chatWidget)
+void ChatWindow::destroyTab(int index)
{
- ChatTab *tab = qobject_cast<ChatTab*>(chatWidget);
+ ChatTab *tab = qobject_cast<ChatTab*>(m_tabWidget->widget(index));
Q_ASSERT(tab);
tab->setChatWindow(0);
- chatWidget->deleteLater();
+ tab->deleteLater();
}
void ChatWindow::setTabText(int index, const QString &newTitle)
@@ -321,7 +319,7 @@ void ChatWindow::setTabTextColor(int index, const QColor& color)
void ChatWindow::closeCurrentTab()
{
- destroyTab(m_tabWidget->currentWidget());
+ destroyTab(m_tabWidget->currentIndex());
}
void ChatWindow::onAudioCallTriggered()
diff --git a/app/chat-window.h b/app/chat-window.h
index 587661f..b0c8ae2 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -76,7 +76,7 @@ Q_SIGNALS:
void detachRequested(ChatTab *tab);
public Q_SLOTS:
- void destroyTab(QWidget *chatWidget);
+ void destroyTab(int index);
protected:
virtual bool event(QEvent *e);
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list