[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:20:20 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=ebd98db

The following commit has been merged in the master branch:
commit ebd98db6cf3d5e288fecc4950b57cb33c82a6260
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Thu Oct 27 13:36:31 2011 +0200

    Better user-is-typing signaling, now it correctly appends the string "Typing..." to the window title (ie. it only appends it when the current opened tab has a currently typing user)
    
    Reviewed-by: Francesco Nwokeka
    REVIEW: 102977
    BUG: 282358
---
 app/chat-window.cpp | 9 ++++++---
 app/chat-window.h   | 2 +-
 lib/chat-widget.cpp | 5 +++++
 lib/chat-widget.h   | 3 +++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 42393d3..93fd66c 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -254,6 +254,9 @@ void ChatWindow::onCurrentIndexChanged(int index)
     setWindowTitle(currentChatTab->title());
     setWindowIcon(currentChatTab->icon());
 
+    //call this to update the "Typing.." in window title
+    onUserTypingChanged();
+
     // when the tab changes I need to "refresh" the window's findNext and findPrev actions
     if (currentChatTab->chatSearchBar()->searchBar()->text().isEmpty()) {
         onEnableSearchActions(false);
@@ -457,7 +460,7 @@ void ChatWindow::setupChatTabSignals(ChatTab *chatTab)
     connect(chatTab, SIGNAL(titleChanged(QString)), this, SLOT(onTabTextChanged(QString)));
     connect(chatTab, SIGNAL(iconChanged(KIcon)), this, SLOT(onTabIconChanged(KIcon)));
     connect(chatTab, SIGNAL(userTypingChanged(bool)), this, SLOT(onTabStateChanged()));
-    connect(chatTab, SIGNAL(userTypingChanged(bool)), this, SLOT(onUserTypingChanged(bool)));
+    connect(chatTab, SIGNAL(userTypingChanged(bool)), this, SLOT(onUserTypingChanged()));
     connect(chatTab, SIGNAL(unreadMessagesChanged(int)), this, SLOT(onTabStateChanged()));
     connect(chatTab, SIGNAL(contactPresenceChanged(Tp::Presence)), this, SLOT(onTabStateChanged()));
     connect(chatTab->chatSearchBar(), SIGNAL(enableSearchButtonsSignal(bool)), this, SLOT(onEnableSearchActions(bool)));
@@ -584,13 +587,13 @@ void ChatWindow::startVideoCall(const Tp::AccountPtr& account, const Tp::Contact
     connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)), this, SLOT(onGenericOperationFinished(Tp::PendingOperation*)));
 }
 
-void ChatWindow::onUserTypingChanged(bool typing)
+void ChatWindow::onUserTypingChanged()
 {
     ChatWidget *currChat =  qobject_cast<ChatWidget*>(m_tabWidget->currentWidget());
     Q_ASSERT(currChat);
     QString title = currChat->title();
 
-    if (typing) {
+    if (currChat->isUserTyping()) {
         setWindowTitle(i18nc("String prepended in window title, arg is contact's name", "Typing... %1", title));
     } else {
         setWindowTitle(title);
diff --git a/app/chat-window.h b/app/chat-window.h
index 9ebf339..bbfd401 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -88,7 +88,7 @@ private Q_SLOTS:
     void onTabTextChanged(const QString &newTitle);
     void onTabIconChanged(const KIcon &newIcon);
     void onVideoCallTriggered();                                /** start a video call */
-    void onUserTypingChanged(bool typing);
+    void onUserTypingChanged();
 
 protected Q_SLOTS:
     void showSettingsDialog();
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 8fe4eeb..ea673b0 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -866,4 +866,9 @@ KIcon ChatWidget::iconForPresence(Tp::ConnectionPresenceType presence)
     return KIcon(iconName);
 }
 
+bool ChatWidget::isUserTyping() const
+{
+    return d->remoteContactIsTyping;
+}
+
 #include "chat-widget.moc"
diff --git a/lib/chat-widget.h b/lib/chat-widget.h
index 5672e1c..31f13d6 100644
--- a/lib/chat-widget.h
+++ b/lib/chat-widget.h
@@ -77,6 +77,9 @@ public:
 
     int unreadMessageCount() const;
 
+    /** Returns true if the user is currently typing or not */
+    bool isUserTyping() const;
+
 public Q_SLOTS:
     /** toggle the search bar visibility */
     void toggleSearchBar() const;

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list