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


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

The following commit has been merged in the master branch:
commit 51a28b875ee0ede8b6ca582e5e06ace196a6881b
Author: Daniele E. Domenichelli <daniele.domenichelli at iit.it>
Date:   Thu Apr 10 18:52:06 2014 +0200

    Use a different set of icons for group chat tabs
---
 lib/chat-widget.cpp | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 0bf369b..7f20c1b 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -58,6 +58,11 @@
 
 #include <sonnet/speller.h>
 
+
+const QString groupChatOnlineIcon(QLatin1String("im-irc"));
+// FIXME We should have a proper icon for this
+const QString groupChatOfflineIcon(QLatin1String("im-irc"));
+
 class ChatWidgetPrivate
 {
 public:
@@ -222,19 +227,23 @@ Tp::AccountPtr ChatWidget::account() const
 
 KIcon ChatWidget::icon() const
 {
-    if (d->account->currentPresence() != Tp::Presence::offline()) {
-        //normal chat - self and one other person.
-        if (!d->isGroupChat) {
+    if (!d->isGroupChat) {
+        if (d->account->currentPresence() != Tp::Presence::offline()) {
+            //normal chat - self and one other person.
             //find the other contact which isn't self.
             Tp::ContactPtr otherContact = d->channel->targetContact();
             return KTp::Presence(otherContact->presence()).icon();
+        } else {
+            return KTp::Presence(Tp::Presence::offline()).icon();
         }
-        else {
-            //group chat
-            return KTp::Presence(Tp::Presence::available()).icon();
+    } else {
+        //group chat
+        if (d->account->currentPresence() != Tp::Presence::offline()) {
+            return KIcon(groupChatOnlineIcon);
+        } else {
+            return KIcon(groupChatOfflineIcon);
         }
     }
-    return KTp::Presence(Tp::Presence::offline()).icon();
 }
 
 KIcon ChatWidget::accountIcon() const
@@ -1021,7 +1030,11 @@ void ChatWidget::currentPresenceChanged(const Tp::Presence &presence)
 {
     if (presence == Tp::Presence::offline()) {
         d->ui.chatArea->addStatusMessage(i18n("You are now offline"));
-        Q_EMIT iconChanged(KTp::Presence(Tp::Presence::offline()).icon());
+        if(!d->isGroupChat) {
+            Q_EMIT iconChanged(KTp::Presence(Tp::Presence::offline()).icon());
+        } else {
+            Q_EMIT iconChanged(KIcon(groupChatOfflineIcon));
+        }
     }
 }
 

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list