[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:04:50 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=c1beeb2

The following commit has been merged in the master branch:
commit c1beeb263a3f8208e96c2a2b59e73dcd9667642a
Author: Lasath Fernando <kde at lasath.org>
Date:   Mon Dec 5 19:34:54 2011 +1100

    UI improvements
---
 KTp/Declarative/conversation-target.cpp   | 38 ++++++++++++++++++++++++++++++-
 KTp/Declarative/conversation-target.h     | 16 +++++++++----
 KTp/Declarative/conversation.h            |  6 ++---
 KTp/Declarative/conversations-model.h     |  4 +++-
 KTp/Declarative/messages-model.cpp        |  3 ++-
 KTp/Declarative/messages-model.h          |  4 ++--
 KTp/Declarative/telepathy-text-observer.h |  5 ++--
 7 files changed, 62 insertions(+), 14 deletions(-)

diff --git a/KTp/Declarative/conversation-target.cpp b/KTp/Declarative/conversation-target.cpp
index c2bc701..7b9e554 100644
--- a/KTp/Declarative/conversation-target.cpp
+++ b/KTp/Declarative/conversation-target.cpp
@@ -50,6 +50,7 @@ void ConversationTarget::setupContactSignals(Tp::ContactPtr contact)
 
 QIcon ConversationTarget::avatar() const
 {
+    //FIXME: return KIcon("im-user") if avatar is unavailable
     return QIcon(d->contact->avatarData().fileName);
 }
 
@@ -60,11 +61,46 @@ QString ConversationTarget::nick() const
 
 QIcon ConversationTarget::presenceIcon() const
 {
-    return ChatWidget::iconForPresence(d->contact->presence().type());
+    return KIcon(presenceIconSource());
 }
 
+QString ConversationTarget::presenceIconSource() const
+{
+    return iconSourceForPresence(d->contact->presence().type());
+}
+
+QString ConversationTarget::iconSourceForPresence(Tp::ConnectionPresenceType presence)
+{
+    QString iconName;
+
+    switch (presence) {
+        case Tp::ConnectionPresenceTypeAvailable:
+            iconName = QLatin1String("user-online");
+            break;
+        case Tp::ConnectionPresenceTypeAway:
+            iconName = QLatin1String("user-away");
+            break;
+        case Tp::ConnectionPresenceTypeExtendedAway:
+            iconName = QLatin1String("user-away-extended");
+            break;
+        case Tp::ConnectionPresenceTypeHidden:
+            iconName = QLatin1String("user-invisible");
+            break;
+        case Tp::ConnectionPresenceTypeBusy:
+            iconName = QLatin1String("user-busy");
+            break;
+        default:
+            iconName = QLatin1String("user-offline");
+            break;
+    }
+
+    return iconName;
+}
+
+
 void ConversationTarget::onPresenceChanged(Tp::Presence)
 {
+    Q_EMIT presenceIconSourceChanged(presenceIconSource());
     Q_EMIT presenceIconChanged(presenceIcon());
 }
 
diff --git a/KTp/Declarative/conversation-target.h b/KTp/Declarative/conversation-target.h
index dbfdec2..4af5a47 100644
--- a/KTp/Declarative/conversation-target.h
+++ b/KTp/Declarative/conversation-target.h
@@ -21,10 +21,12 @@
 #define CONVERSATION_TARGET_H
 
 #include <QObject>
-#include <TelepathyQt4/Contact>
+#include <TelepathyQt/Contact>
 
 #include "chat-widget.h"
-#include "kdetelepathychat_export.h"
+
+#include "ktpchat_export.h"
+
 
 class KDE_TELEPATHY_CHAT_EXPORT ConversationTarget : public QObject
 {
@@ -33,6 +35,7 @@ Q_OBJECT
 Q_PROPERTY(QIcon avatar READ avatar NOTIFY avatarChanged);
 Q_PROPERTY(QString nick READ nick NOTIFY nickChanged);
 Q_PROPERTY(QIcon presenceIcon READ presenceIcon NOTIFY presenceIconChanged);
+Q_PROPERTY(QString presenceIconSource READ presenceIconSource NOTIFY presenceIconSourceChanged);
 
 //turns out you can't have non QObjects as properties
 // Q_PROPERTY(Tp::ContactPtr contact READ contact WRITE setContact NOTIFY contactChanged);
@@ -41,17 +44,22 @@ public:
     ConversationTarget( Tp::ContactPtr contact = Tp::ContactPtr());
     virtual ~ConversationTarget();
 
-    QIcon avatar() const;
+    QIcon   avatar() const;
     QString nick() const;
-    QIcon presenceIcon() const;
+    QIcon   presenceIcon() const;
+    QString presenceIconSource() const;
 
     Tp::ContactPtr contact() const;
     void setContact(Tp::ContactPtr contact);
+  
+    static QString iconSourceForPresence(Tp::ConnectionPresenceType presence);
 
+    
 Q_SIGNALS:
     void avatarChanged(QIcon avatar);
     void nickChanged(QString nick);
     void presenceIconChanged(QIcon icon);
+    void presenceIconSourceChanged(QString source);
 
     void contactChanged(Tp::ContactPtr contact);
 
diff --git a/KTp/Declarative/conversation.h b/KTp/Declarative/conversation.h
index 439150b..65e77bc 100644
--- a/KTp/Declarative/conversation.h
+++ b/KTp/Declarative/conversation.h
@@ -20,11 +20,11 @@
 #ifndef CONVERSATION_H
 #define CONVERSATION_H
 
-#include "kdetelepathychat_export.h"
+#include "ktpchat_export.h"
 
 #include <QObject>
-#include <TelepathyQt4/Account>
-#include <TelepathyQt4/TextChannel>
+#include <TelepathyQt/Account>
+#include <TelepathyQt/TextChannel>
 // #include "conversation-model.h"
 #include <KIcon>
 #include "conversation-target.h"
diff --git a/KTp/Declarative/conversations-model.h b/KTp/Declarative/conversations-model.h
index c56cee7..4af433c 100644
--- a/KTp/Declarative/conversations-model.h
+++ b/KTp/Declarative/conversations-model.h
@@ -21,7 +21,9 @@
 #define CONVERSATIONS_MODEL_H
 
 #include <QAbstractListModel>
-#include "kdetelepathychat_export.h"
+
+#include "ktpchat_export.h"
+
 
 class Conversation;
 
diff --git a/KTp/Declarative/messages-model.cpp b/KTp/Declarative/messages-model.cpp
index 989752e..bc85936 100644
--- a/KTp/Declarative/messages-model.cpp
+++ b/KTp/Declarative/messages-model.cpp
@@ -88,7 +88,8 @@ void MessagesModel::setTextChannel(Tp::TextChannelPtr channel)
     if(d->textChannel) {
         removeChannelSignals(channel);
     }
-    d->textChannel = channel;   //FIXME: check if channel is valid
+    //FIXME: check messageQue for any lost messages
+    d->textChannel = channel;
 
     textChannelChanged(channel);
 }
diff --git a/KTp/Declarative/messages-model.h b/KTp/Declarative/messages-model.h
index 720ee1f..6ce698a 100644
--- a/KTp/Declarative/messages-model.h
+++ b/KTp/Declarative/messages-model.h
@@ -20,10 +20,10 @@
 #ifndef MESSAGES_MODEL_H
 #define MESSAGES_MODEL_H
 
-#include "kdetelepathychat_export.h"
+#include "ktpchat_export.h"
 
 #include <QAbstractItemModel>
-#include <TelepathyQt4/TextChannel>
+#include <TelepathyQt/TextChannel>
 
 
 class KDE_TELEPATHY_CHAT_EXPORT MessagesModel : public QAbstractListModel
diff --git a/KTp/Declarative/telepathy-text-observer.h b/KTp/Declarative/telepathy-text-observer.h
index dcec492..9025081 100644
--- a/KTp/Declarative/telepathy-text-observer.h
+++ b/KTp/Declarative/telepathy-text-observer.h
@@ -20,8 +20,9 @@
 #ifndef TELEPATHY_TEXT_OBSERVER_H
 #define TELEPATHY_TEXT_OBSERVER_H
 
-#include "kdetelepathychat_export.h"
-#include <TelepathyQt4/AbstractClient>
+#include "ktpchat_export.h"
+
+#include <TelepathyQt/AbstractClient>
 
 class Conversation;
 

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list