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


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

The following commit has been merged in the master branch:
commit 1daf1d85e753923bf197ad90e1dee4cbff6e660e
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Sat Sep 18 11:35:32 2010 +0000

    Load styles from ktelepathy/styles, not Kopete + various tiny bug fixes.
    
    svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1176708
---
 lib/channelcontactlist.cpp     | 19 ++++++++++++++++++-
 lib/channelcontactlist.h       | 10 +++++++++-
 lib/chatview.cpp               |  6 ++++--
 lib/chatwindow.cpp             |  3 +--
 lib/chatwindowstyle.cpp        |  9 +++++++--
 lib/chatwindowstyle.h          |  3 +++
 lib/chatwindowstylemanager.cpp |  5 +++--
 lib/telepathychatmessageinfo.h |  3 ---
 8 files changed, 45 insertions(+), 13 deletions(-)

diff --git a/lib/channelcontactlist.cpp b/lib/channelcontactlist.cpp
index d1f897a..e73bbf1 100644
--- a/lib/channelcontactlist.cpp
+++ b/lib/channelcontactlist.cpp
@@ -1,5 +1,5 @@
 #include "channelcontactlist.h"
-
+#include <TelepathyQt4/Contact>
 
 /** reif This class provides an abstracted way of getting presence changes from a contact
   * It was needed to be able to pair up a contact changing, with the name of the contact.
@@ -9,6 +9,15 @@
 
 /** Internal private class*/
 
+/*
+ [23:50] <oggis_> if you want to show events just for the current members, then i'd maintain said list/set by connecting to
+groupMembersChanged and adding to it everybody in the groupMembersAdded set, and removing to it everybody in any of the
+other sets (taking set union of them is easiest)
+ */
+
+
+
+
 ChannelContactListContact::ChannelContactListContact(Tp::ContactPtr contact, QObject *parent)
         : QObject(parent)
 {
@@ -30,6 +39,14 @@ ChannelContactList::ChannelContactList(Tp::TextChannelPtr channel, QObject *pare
         //FIXME move this to a slot called "addContact" - also call this when chat gains a person.
         ChannelContactListContact*  contactProxy = new ChannelContactListContact(contact, this);
         connect(contactProxy, SIGNAL(contactPresenceChanged(Tp::ContactPtr, uint)), SIGNAL(contactPresenceChanged(Tp::ContactPtr, uint)));
+        qDebug() << contact->alias();
     }
+    connect(channel.data(), SIGNAL(groupMembersChanged(Tp::Contacts, Tp::Contacts, Tp::Contacts, Tp::Contacts, Tp::Channel::GroupMemberChangeDetails)),
+            SLOT(groupMembersChanged(Tp::Contacts, Tp::Contacts, Tp::Contacts, Tp::Contacts, Tp::Channel::GroupMemberChangeDetails)));
+}
+
+void ChannelContactList::groupMembersChanged(const Tp::Contacts &groupMembersAdded, const Tp::Contacts &groupLocalPendingMembersAdded, const Tp::Contacts &groupRemotePendingMembersAdded, const Tp::Contacts &groupMembersRemoved, const Tp::Channel::GroupMemberChangeDetails &details)
+{
+    qDebug() << "members changed.";
 }
 
diff --git a/lib/channelcontactlist.h b/lib/channelcontactlist.h
index d358b7d..8c49fdf 100644
--- a/lib/channelcontactlist.h
+++ b/lib/channelcontactlist.h
@@ -4,7 +4,8 @@
 #include <QObject>
 #include <TelepathyQt4/TextChannel>
 #include <TelepathyQt4/Contact>
-
+#include <TelepathyQt4/Types>
+#include <TelepathyQt4/Channel>
 
 class ChannelContactListContact: public QObject
 {
@@ -35,7 +36,14 @@ signals:
     void contactPresenceChanged(Tp::ContactPtr contact, uint type);
 
 public slots:
+    void groupMembersChanged(const Tp::Contacts &groupMembersAdded,
+                             const Tp::Contacts &groupLocalPendingMembersAdded,
+                             const Tp::Contacts &groupRemotePendingMembersAdded,
+                             const Tp::Contacts &groupMembersRemoved,
+                             const Tp::Channel::GroupMemberChangeDetails &details);
 
+private:
+    QSet<ChannelContactListContact> contacts;
 };
 
 
diff --git a/lib/chatview.cpp b/lib/chatview.cpp
index c0a1455..eb46fb9 100644
--- a/lib/chatview.cpp
+++ b/lib/chatview.cpp
@@ -43,7 +43,6 @@ ChatView::ChatView(QWidget *parent) :
         m_displayHeader(true)
 {
     //determine the chat window style to use (from the Kopete config file).
-    //FIXME use our own config file. I think we probably want everything from the appearance config group in ours, so it's a simple change.
 
     KSharedConfigPtr config = KSharedConfig::openConfig("ktelepathyrc");
     KConfigGroup appearanceConfig = config->group("Appearance");
@@ -90,7 +89,10 @@ void ChatView::initialise(const TelepathyChatInfo &chatInfo)
     templateHtml.replace("%extraStyleCode%", ""); // FIXME once we get some font/background from the config file, put it here
     templateHtml.replace("%variant%", m_variantPath);
     templateHtml.replace("%header%", headerHtml);
-    templateHtml.replace("%footer%", m_chatStyle->getFooterHtml());
+
+    QString footerHtml;
+    footerHtml = replaceHeaderKeywords(m_chatStyle->getFooterHtml(), chatInfo);
+    templateHtml.replace("%footer%", footerHtml);
 
     setHtml(templateHtml);
     lastSender = "";
diff --git a/lib/chatwindow.cpp b/lib/chatwindow.cpp
index 79e91c3..fad1d73 100644
--- a/lib/chatwindow.cpp
+++ b/lib/chatwindow.cpp
@@ -218,8 +218,7 @@ void ChatWindow::updateEnabledState(bool enable)
 
         //set up anything related to 'self'
         info.setOutgoingIconPath(m_chatConnection->channel()->groupSelfContact()->avatarToken());
-        info.setTimeOpened(QDateTime::currentDateTime()); //FIXME how do I know when the channel opened? Using current time for now.
-
+        info.setTimeOpened(QDateTime::currentDateTime());
         ui->chatArea->initialise(info);
 
         //inform anyone using the class of the new name for this chat.
diff --git a/lib/chatwindowstyle.cpp b/lib/chatwindowstyle.cpp
index 2d31a37..6c523c9 100644
--- a/lib/chatwindowstyle.cpp
+++ b/lib/chatwindowstyle.cpp
@@ -72,9 +72,8 @@ ChatWindowStyle::ChatWindowStyle(const QString &styleName, const QString &varian
 
 void ChatWindowStyle::init(const QString &styleName, StyleBuildMode styleBuildMode)
 {
-    //FIXME stop looking in Kopete's directory!
+    QStringList styleDirs = KGlobal::dirs()->findDirs("data", QString("ktelepathy/styles/%1/Contents/Resources/").arg(styleName));
 
-    QStringList styleDirs = KGlobal::dirs()->findDirs("data", QString("kopete/styles/%1/Contents/Resources/").arg(styleName));
     if (styleDirs.isEmpty()) {
         kDebug(14000) << "Failed to find style" << styleName;
         return;
@@ -121,6 +120,12 @@ QString ChatWindowStyle::getStyleBaseHref() const
     return d->baseHref;
 }
 
+
+bool ChatWindowStyle::hasHeader() const
+{
+   return ! d->headerHtml.isEmpty();
+}
+
 QString ChatWindowStyle::getHeaderHtml() const
 {
     return d->headerHtml;
diff --git a/lib/chatwindowstyle.h b/lib/chatwindowstyle.h
index 338c3d6..752fd83 100644
--- a/lib/chatwindowstyle.h
+++ b/lib/chatwindowstyle.h
@@ -92,6 +92,9 @@ public:
      */
     QString getStyleBaseHref() const;
 
+    /** Returns true if this style supports showing a header at the top of the chat window*/
+
+    bool hasHeader() const;
     QString getHeaderHtml() const;
     QString getFooterHtml() const;
     QString getIncomingHtml() const;
diff --git a/lib/chatwindowstylemanager.cpp b/lib/chatwindowstylemanager.cpp
index 8208bc5..f3c2c49 100644
--- a/lib/chatwindowstylemanager.cpp
+++ b/lib/chatwindowstylemanager.cpp
@@ -82,9 +82,10 @@ ChatWindowStyleManager::~ChatWindowStyleManager()
 void ChatWindowStyleManager::loadStyles()
 {
     // Make sure there exists a directory where chat styles can be installed to and it will be watched for changes
-    KStandardDirs::locateLocal("data", QLatin1String("kopete/styles/"));
+    KStandardDirs::locateLocal("data", QLatin1String("ktelepathy/styles/"));
+
+    QStringList chatStyles = KGlobal::dirs()->findDirs("data", QLatin1String("ktelepathy/styles"));
 
-    QStringList chatStyles = KGlobal::dirs()->findDirs("data", QLatin1String("kopete/styles"));
     foreach(const QString &styleDir, chatStyles) {
         kDebug(14000) << styleDir;
         d->styleDirs.push(KUrl(styleDir));
diff --git a/lib/telepathychatmessageinfo.h b/lib/telepathychatmessageinfo.h
index 5e10572..1cb965f 100644
--- a/lib/telepathychatmessageinfo.h
+++ b/lib/telepathychatmessageinfo.h
@@ -26,8 +26,6 @@
 
 /** This class contains all the information that is needed for a message or status message*/
 
-//FIXME enum type for incoming, outgoing or status. Set on construct.
-//messageDirection only has getter based on this
 //no value handling to be done in this class.
 
 //rules for this class
@@ -151,7 +149,6 @@ private:
     QString m_userIcons;
 
     /** A space separated list of type information for messages, suitable for use as a class attribute. Currently available types are listed below. */
-    //do this on my magical "messageType enum"
     QString m_messageClasses;
 
     /** A description of the status event. This is neither in the user's local language nor expected to be displayed; it may be useful to use a different div class to present different types of status messages. The following is a list of some of the more important status messages; your message style should be able to handle being shown a status message not in this list, as even at present the list is incomplete and is certain to become out of date in the future: */

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list