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


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

The following commit has been merged in the master branch:
commit 3885b4ab304b8c6f524bd80c5ac34f308a9ec84c
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Thu Sep 23 02:00:25 2010 +0000

    Added final AdiumThemeMessageInfo class for passing adium theme data.
    This now fully deprecates TelepathyChatMessageInfo.
    
    svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1178420
---
 lib/CMakeLists.txt            |  1 +
 lib/adiumthemecontentinfo.cpp |  7 ++--
 lib/adiumthemecontentinfo.h   |  6 ++-
 lib/adiumthememessageinfo.cpp | 90 +++++++++++++++++++++++++++++++++++++++++++
 lib/adiumthememessageinfo.h   | 43 +++++++++++++++++++++
 lib/adiumthemestatusinfo.cpp  |  1 +
 lib/adiumthemestatusinfo.h    |  5 ++-
 7 files changed, 146 insertions(+), 7 deletions(-)

diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index a757149..a4b3327 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -6,6 +6,7 @@ set(telepathy_chat_handler_lib_SRCS
         adiumthemeview.cpp
         telepathychatmessageinfo.cpp
         adiumthemeheaderinfo.cpp
+        adiumthememessageinfo.cpp
         adiumthemecontentinfo.cpp
         adiumthemestatusinfo.cpp
         channelcontactlist.cpp
diff --git a/lib/adiumthemecontentinfo.cpp b/lib/adiumthemecontentinfo.cpp
index 03b9e5a..3eaef75 100644
--- a/lib/adiumthemecontentinfo.cpp
+++ b/lib/adiumthemecontentinfo.cpp
@@ -13,9 +13,11 @@ public:
     QString textbackgroundcolor;
 };
 
-AdiumThemeContentInfo::AdiumThemeContentInfo() :
-        d(new AdiumThemeContentInfoPrivate)
+AdiumThemeContentInfo::AdiumThemeContentInfo(AdiumThemeMessageInfo::MessageType type) :
+  AdiumThemeMessageInfo(type),
+  d(new AdiumThemeContentInfoPrivate)
 {
+
 }
 
 QString AdiumThemeContentInfo::userIconPath() const
@@ -43,7 +45,6 @@ QString AdiumThemeContentInfo::sender() const
     return d->senderDisplayName;
 }
 
-
 QString AdiumThemeContentInfo::senderColor() const
 {
     return d->senderColor;
diff --git a/lib/adiumthemecontentinfo.h b/lib/adiumthemecontentinfo.h
index 0acaa35..2755d1d 100644
--- a/lib/adiumthemecontentinfo.h
+++ b/lib/adiumthemecontentinfo.h
@@ -1,14 +1,16 @@
 #ifndef ADIUMTHEMECONTENTINFO_H
 #define ADIUMTHEMECONTENTINFO_H
+#include "adiumthememessageinfo.h"
 
 class QString;
 class AdiumThemeContentInfoPrivate;
 
 
-class AdiumThemeContentInfo
+
+class AdiumThemeContentInfo : AdiumThemeMessageInfo
 {
 public:
-    explicit AdiumThemeContentInfo();
+    explicit AdiumThemeContentInfo(AdiumThemeMessageInfo::MessageType);
 
     /** Path to the user icon associated with this message */
     QString userIconPath() const;
diff --git a/lib/adiumthememessageinfo.cpp b/lib/adiumthememessageinfo.cpp
new file mode 100644
index 0000000..cf891d5
--- /dev/null
+++ b/lib/adiumthememessageinfo.cpp
@@ -0,0 +1,90 @@
+#include "adiumthememessageinfo.h"
+#include <QString>
+#include <QStringList>
+#include <QDateTime>
+
+class AdiumThemeMessageInfoPrivate
+{
+public:
+    QString message;
+    QDateTime time;
+    QString service;
+    QStringList messageClasses;
+    AdiumThemeMessageInfo::MessageType type;
+};
+
+AdiumThemeMessageInfo::AdiumThemeMessageInfo(MessageType type)
+    : d(new AdiumThemeMessageInfoPrivate())
+{
+    d->type = type;
+}
+
+AdiumThemeMessageInfo::MessageType AdiumThemeMessageInfo::type() const
+{
+    return d->type;
+}
+
+QString AdiumThemeMessageInfo::message() const
+{
+    return d->message;
+}
+
+void AdiumThemeMessageInfo::setMessage(const QString& message)
+{
+    d->message = message;
+}
+
+QDateTime AdiumThemeMessageInfo::time() const
+{
+    return d->time;
+}
+
+void AdiumThemeMessageInfo::setTime(const QDateTime& time)
+{
+    d->time = time;
+}
+
+QString AdiumThemeMessageInfo::service() const
+{
+    return d->service;
+}
+
+void AdiumThemeMessageInfo::setService(const QString& service)
+{
+    d->service = service;
+}
+
+QString AdiumThemeMessageInfo::userIcons() const
+{
+    //FIXME.
+    return QString("showIcons");
+}
+
+QString AdiumThemeMessageInfo::messageClasses() const {
+    //in the future this will also contain history, consecutive, autoreply, status, event
+    //these will be stored internally as flags
+
+    QStringList classes = d->messageClasses;
+
+    if (d->type == RemoteToLocal) {
+        classes.append("incoming");
+        classes.append("message");
+    }
+
+    if (d->type == LocalToRemote) {
+        classes.append("outgoing");
+        classes.append("message");
+    }
+
+    if (d->type == Status) {
+        classes.append("status");
+    }
+
+    return classes.join(" ");
+}
+
+
+void AdiumThemeMessageInfo::appendMessageClass(const QString &messageClass)
+{
+    d->messageClasses.append(messageClass);
+}
diff --git a/lib/adiumthememessageinfo.h b/lib/adiumthememessageinfo.h
new file mode 100644
index 0000000..2eef423
--- /dev/null
+++ b/lib/adiumthememessageinfo.h
@@ -0,0 +1,43 @@
+#ifndef ADIUMTHEMEMESSAGEINFO_H
+#define ADIUMTHEMEMESSAGEINFO_H
+
+class QString;
+class QDateTime;
+class AdiumThemeMessageInfoPrivate;
+
+class AdiumThemeMessageInfo
+{
+public:
+    enum MessageType {
+        RemoteToLocal,
+        LocalToRemote,
+        Status
+    };
+
+    explicit AdiumThemeMessageInfo(MessageType);
+
+    MessageType type() const;
+
+    /** The message itself of the message/status. */
+    QString message() const;
+    void setMessage(const QString& message);
+
+    /** The time at which message/status occurred*/
+    QDateTime time() const;
+    void setTime(const QDateTime& time);
+
+    QString service() const;
+    void setService(const QString& service);
+
+    /** Will be replaced with "showIcons" if the "Show user icons" checkbox is selected,*/
+    //FIXME in here or in AdiumThemeView..?
+    QString userIcons() const;
+
+    QString messageClasses() const;
+    void appendMessageClass(const QString& messageClass);
+
+private:
+    AdiumThemeMessageInfoPrivate* d;
+};
+
+#endif // ADIUMTHEMEMESSAGEINFO_H
diff --git a/lib/adiumthemestatusinfo.cpp b/lib/adiumthemestatusinfo.cpp
index f58cc55..4f42242 100644
--- a/lib/adiumthemestatusinfo.cpp
+++ b/lib/adiumthemestatusinfo.cpp
@@ -8,6 +8,7 @@ public:
 };
 
 AdiumThemeStatusInfo::AdiumThemeStatusInfo():
+        AdiumThemeMessageInfo(AdiumThemeMessageInfo::Status),
         d(new AdiumThemeStatusInfoPrivate)
 {
 }
diff --git a/lib/adiumthemestatusinfo.h b/lib/adiumthemestatusinfo.h
index 5e451bd..1c7eed7 100644
--- a/lib/adiumthemestatusinfo.h
+++ b/lib/adiumthemestatusinfo.h
@@ -1,13 +1,14 @@
 #ifndef ADIUMTHEMESTATUSINFO_H
 #define ADIUMTHEMESTATUSINFO_H
 
+#include "adiumthememessageinfo.h"
 class QString;
 class AdiumThemeStatusInfoPrivate;
 
-class AdiumThemeStatusInfo
+class AdiumThemeStatusInfo : AdiumThemeMessageInfo
 {
 public:
-    AdiumThemeStatusInfo();
+    explicit AdiumThemeStatusInfo();
 
     /** A description of the status event. This is neither in the user's local language nor expected to be displayed*/
     QString status() const;

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list