[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:19:34 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=5b1590c
The following commit has been merged in the master branch:
commit 5b1590c38f757bb62c50986877f58c67c3f43bed
Author: Lasath Fernando <kde at lasath.org>
Date: Wed Jul 6 13:36:22 2011 +0530
Minor Fixes.
disconnect/reconnect signals when removing/adding tab from window.
use deleteLater in destroyTab instead of deleting outright
---
app/chat-window.cpp | 31 +++++++++++++++++++++++--------
app/chat-window.h | 1 +
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 374babe..0f58b45 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -93,12 +93,13 @@ ChatWindow::~ChatWindow()
void ChatWindow::tabBarContextMenu(int index, const QPoint& globalPos)
{
- KAction close("Close", this);
+// KIconLoader::global()->loadIcon("close-tab", KIconLoader::Small)
+ KAction close(KIcon("tab-close", KIconLoader::global()), "Close", this);
KAction dettach("Dettach Tab", this);
-
KAction moveLeft("Move Tab Left", this), moveRight("Move Tab Right", this);
KMenu* menu = new KMenu(this);
+
menu->addAction(&moveLeft);
menu->addAction(&moveRight);
menu->addAction(&dettach);
@@ -131,8 +132,8 @@ ChatTab* ChatWindow::getTab ( const Tp::TextChannelPtr& incomingTextChannel )
if (!incomingTextChannel->targetHandleType() == Tp::HandleTypeNone) {
kDebug() << "ChatWindow::startChat target handle type is NOT HandleTypeNone";
- // check that the tab requested isn't already open
- for (int index = 0; index < m_tabWidget->count()/* && !match*/; ++index) {
+ // check that the tab requested isn't already open
+ for (int index = 0; index < m_tabWidget->count() && !match; ++index) {
// get chatWidget object
ChatTab *auxChatTab = qobject_cast<ChatTab*>(m_tabWidget->widget(index));
@@ -143,7 +144,6 @@ ChatTab* ChatWindow::getTab ( const Tp::TextChannelPtr& incomingTextChannel )
if (auxChatTab->textChannel()->targetId() == incomingTextChannel->targetId()
&& auxChatTab->textChannel()->targetHandleType() == incomingTextChannel->targetHandleType()) {
match = auxChatTab;
-
}
}
}
@@ -151,8 +151,12 @@ ChatTab* ChatWindow::getTab ( const Tp::TextChannelPtr& incomingTextChannel )
return match;
}
-void ChatWindow::removeTab ( ChatTab* tab )
+void ChatWindow::removeTab(ChatTab* tab)
{
+ kDebug();
+
+ removeChatTabSignals(tab);
+
m_tabWidget->removePage(tab);
if (!m_tabWidget->isTabBarHidden()){
@@ -166,6 +170,8 @@ void ChatWindow::addTab ( ChatTab* tab )
{
kDebug();
+ setupChatTabSignals(tab);
+
m_tabWidget->addTab(tab, tab->icon(), tab->title());
m_tabWidget->setCurrentWidget(tab);
@@ -184,7 +190,7 @@ void ChatWindow::destroyTab(QWidget* chatWidget)
Q_ASSERT(tab);
tab->setWindow(NULL);
- delete chatWidget;
+ chatWidget->deleteLater();
}
void ChatWindow::setTabText(int index, const QString &newTitle)
@@ -419,7 +425,6 @@ void ChatWindow::createNewChat(const Tp::TextChannelPtr &channelPtr, const Tp::A
kDebug();
ChatTab *chatTab = new ChatTab(channelPtr, accountPtr, m_tabWidget);
- setupChatTabSignals(chatTab);
chatTab->setWindow(this);
}
@@ -449,6 +454,16 @@ void ChatWindow::setupChatTabSignals(ChatTab *chatTab)
connect(chatTab->chatSearchBar(), SIGNAL(enableSearchButtonsSignal(bool)), this, SLOT(onEnableSearchActions(bool)));
}
+void ChatWindow::removeChatTabSignals(ChatTab* chatTab)
+{
+ disconnect(chatTab, SIGNAL(titleChanged(QString)), this, SLOT(onTabTextChanged(QString)));
+ disconnect(chatTab, SIGNAL(iconChanged(KIcon)), this, SLOT(onTabIconChanged(KIcon)));
+ disconnect(chatTab, SIGNAL(userTypingChanged(bool)), this, SLOT(onTabStateChanged()));
+ disconnect(chatTab, SIGNAL(unreadMessagesChanged(int)), this, SLOT(onTabStateChanged()));
+ disconnect(chatTab, SIGNAL(contactPresenceChanged(Tp::Presence)), this, SLOT(onTabStateChanged()));
+ disconnect(chatTab->chatSearchBar(), SIGNAL(enableSearchButtonsSignal(bool)), this, SLOT(onEnableSearchActions(bool)));
+}
+
void ChatWindow::setupCustomActions()
{
KAction *separator = new KAction(this);
diff --git a/app/chat-window.h b/app/chat-window.h
index 0015ba8..d5c7859 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -103,6 +103,7 @@ private:
* @param chatTab chatTab object to connect
*/
void setupChatTabSignals(ChatTab *chatTab);
+ void removeChatTabSignals(ChatTab *chatTab);
/** creates and adds custom actions for the chat window */
void setupCustomActions();
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list