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


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

The following commit has been merged in the master branch:
commit 1df722aa5c796647e87dfbc9690d63e1bf5c53f2
Author: Lasath Fernando <kde at lasath.org>
Date:   Mon Feb 13 12:32:35 2012 +1100

    The Delegate Channels Patch a.k.a David's massive patch
    
    In the plasmoid:
    Convert plasmoid to a handler from an observer
    Support delegate channels (via a nasty hack currently)
    Add popout button to delegate to main text UI
    Merge the conversationsModel and handler into one class
    Fix exposing a load of items to QML for no reason.
    Some additional tidying. (and some additional messying :-) )
    Clear unread messages on TextChannel::pendingMessagesRemoved()
    
    In the textUI:
    Always raise the window in the main Text UI handleChannel unless
     hint explicitly says otherwise.
    Additionally fixes a bug in which reconnecting an account could
    cause the tabs to 'randomly' switch.
    
    REVIEW: 103908
    CCBUG: 293526
---
 app/chat-tab.cpp                                   | 13 ++-
 app/telepathy-chat-ui.cpp                          | 18 ++--
 plasmoid/declarative-plugin/conversation.cpp       | 14 +++-
 plasmoid/declarative-plugin/conversation.h         |  9 +-
 .../declarative-plugin/conversations-model.cpp     | 96 +++++++++++++++++-----
 plasmoid/declarative-plugin/conversations-model.h  | 16 +++-
 plasmoid/declarative-plugin/messages-model.cpp     | 10 ---
 plasmoid/declarative-plugin/messages-model.h       |  3 -
 plasmoid/declarative-plugin/qml-plugins.cpp        |  9 --
 .../declarative-plugin/telepathy-text-observer.cpp | 65 ++++-----------
 .../declarative-plugin/telepathy-text-observer.h   | 16 ++--
 .../contents/ui/ChatWidget.qml                     | 23 +++++-
 .../org.kde.ktp-chatplasmoid/contents/ui/main.qml  | 16 ++--
 13 files changed, 174 insertions(+), 134 deletions(-)

diff --git a/app/chat-tab.cpp b/app/chat-tab.cpp
index a395263..299c292 100644
--- a/app/chat-tab.cpp
+++ b/app/chat-tab.cpp
@@ -81,15 +81,22 @@ void ChatTab::showOnTop()
 void ChatTab::onConnectionStatusChanged(Tp::ConnectionStatus status)
 {
     // request a new text channel for the chat
+
+    Tp::ChannelRequestHints hints;
+    hints.setHint(QLatin1String("org.kde.telepathy"),QLatin1String("suppressWindowRaise"), QVariant(true));
+
     if (status == Tp::ConnectionStatusConnected) {
         if (textChannel()->targetHandleType() == Tp::HandleTypeContact) {
             account()->ensureTextChat(textChannel()->targetId(),
                                       QDateTime::currentDateTime(),
-                                      QLatin1String(KTP_TEXTUI_CLIENT_PATH));
+                                      QLatin1String(KTP_TEXTUI_CLIENT_PATH),
+                                      hints);
         } else if (textChannel()->targetHandleType() == Tp::HandleTypeRoom) {
+
             account()->ensureTextChatroom(textChannel()->targetId(),
-                                                   QDateTime::currentDateTime(),
-                                                   QLatin1String(KTP_TEXTUI_CLIENT_PATH));
+                                          QDateTime::currentDateTime(),
+                                          QLatin1String(KTP_TEXTUI_CLIENT_PATH),
+                                          hints);
         }
     }
 }
diff --git a/app/telepathy-chat-ui.cpp b/app/telepathy-chat-ui.cpp
index 91ef0e3..37d16f4 100644
--- a/app/telepathy-chat-ui.cpp
+++ b/app/telepathy-chat-ui.cpp
@@ -115,15 +115,15 @@ void TelepathyChatUi::handleChannels(const Tp::MethodInvocationContextPtr<> & co
      * If the special hint org.kde.telepathy forceRaiseWindow is set to true, then we use KWindowSystem::forceActiveWindow
      * to claim focus.
      */
-    bool forceRaiseWindowHint = false;
+    bool windowRaise = true;
 
     //find the relevant channelRequest
     Q_FOREACH(const Tp::ChannelRequestPtr channelRequest, channelRequests) {
         kDebug() << channelRequest->hints().allHints();
-        forceRaiseWindowHint = channelRequest->hints().hint(QLatin1String("org.kde.telepathy"), QLatin1String("forceRaiseWindow")).toBool();
+        windowRaise = !channelRequest->hints().hint(QLatin1String("org.kde.telepathy"), QLatin1String("suppressWindowRaise")).toBool();
     }
 
-    kDebug() << "force raise window hint set to: " << forceRaiseWindowHint;
+    kDebug() << "raise window hint set to: " << windowRaise;
 
     bool tabFound = false;
 
@@ -134,7 +134,10 @@ void TelepathyChatUi::handleChannels(const Tp::MethodInvocationContextPtr<> & co
 
         if (tab) {
             tabFound = true;
-            window->focusChat(tab);                 // set focus on selected tab
+            if (windowRaise) {
+                window->focusChat(tab);                 // set focus on selected tab
+                KWindowSystem::forceActiveWindow(window->winId());
+            }
 
             // check if channel is invalid. Replace only if invalid
             // You get this status if user goes offline and then back on without closing the chat
@@ -143,11 +146,6 @@ void TelepathyChatUi::handleChannels(const Tp::MethodInvocationContextPtr<> & co
                 tab->setChatEnabled(true);           // re-enable chat
             }
         }
-
-        if (forceRaiseWindowHint) {
-            KWindowSystem::forceActiveWindow(window->winId());
-        }
-
     }
 
     //if there is currently no tab containing the incoming channel.
@@ -169,7 +167,7 @@ void TelepathyChatUi::handleChannels(const Tp::MethodInvocationContextPtr<> & co
         tab->setChatWindow(window);
         window->show();
 
-        if (forceRaiseWindowHint) {
+        if (windowRaise) {
             KWindowSystem::forceActiveWindow(window->winId());
         }
     }
diff --git a/plasmoid/declarative-plugin/conversation.cpp b/plasmoid/declarative-plugin/conversation.cpp
index c2f707a..152d940 100644
--- a/plasmoid/declarative-plugin/conversation.cpp
+++ b/plasmoid/declarative-plugin/conversation.cpp
@@ -24,12 +24,16 @@
 #include <KDebug>
 #include "conversation-target.h"
 
+#include "channel-delegator.h"
+
+
 class Conversation::ConversationPrivate
 {
 public:
     MessagesModel *messages;
     ConversationTarget *target;
     bool valid;
+    Tp::AccountPtr account;
 };
 
 Conversation::Conversation(const Tp::TextChannelPtr& channel,
@@ -40,6 +44,8 @@ Conversation::Conversation(const Tp::TextChannelPtr& channel,
 {
     kDebug();
 
+    d->account = account;
+
     d->messages = new MessagesModel(this);
     d->messages->setTextChannel(channel);
 
@@ -80,10 +86,15 @@ void Conversation::onChannelInvalidated(Tp::DBusProxy* proxy, const QString& err
     Q_EMIT validityChanged(d->valid);
 }
 
+void Conversation::delegateToProperClient()
+{
+    ChannelDelegator::delegateChannel(d->account, d->messages->textChannel());
+}
+
 void Conversation::requestClose()
 {
     kDebug();
-    d->messages->requestClose();
+    d->messages->textChannel()->requestClose();
 }
 
 Conversation::~Conversation()
@@ -91,3 +102,4 @@ Conversation::~Conversation()
     kDebug();
     delete d;
 }
+
diff --git a/plasmoid/declarative-plugin/conversation.h b/plasmoid/declarative-plugin/conversation.h
index 78fd38d..6eeab86 100644
--- a/plasmoid/declarative-plugin/conversation.h
+++ b/plasmoid/declarative-plugin/conversation.h
@@ -27,8 +27,10 @@
 #include <TelepathyQt/TextChannel>
 
 #include <KIcon>
-#include "conversation-que-manager.h"
 
+#include "conversation-que-manager.h"
+#include "conversation-target.h"
+#include "messages-model.h"
 
 class ConversationTarget;
 class MessagesModel;
@@ -36,8 +38,8 @@ class KDE_TELEPATHY_CHAT_EXPORT Conversation : public QObject
 {
 Q_OBJECT
 
-Q_PROPERTY(ConversationTarget* target READ target CONSTANT);
-Q_PROPERTY(MessagesModel* messages READ messages CONSTANT);
+Q_PROPERTY(QObject* target READ target CONSTANT);
+Q_PROPERTY(QObject* messages READ messages CONSTANT);
 Q_PROPERTY(bool valid READ isValid NOTIFY validityChanged);
 
 public:
@@ -54,6 +56,7 @@ Q_SIGNALS:
     void validityChanged(bool isValid);
 
 public Q_SLOTS:
+    void delegateToProperClient();
     void requestClose();
 
 private Q_SLOTS:
diff --git a/plasmoid/declarative-plugin/conversations-model.cpp b/plasmoid/declarative-plugin/conversations-model.cpp
index 3967bff..74745f4 100644
--- a/plasmoid/declarative-plugin/conversations-model.cpp
+++ b/plasmoid/declarative-plugin/conversations-model.cpp
@@ -19,27 +19,35 @@
 
 #include "conversations-model.h"
 #include "conversation.h"
-#include "telepathy-text-observer.h"
-#include <KDebug>
 #include "conversation-target.h"
 #include "messages-model.h"
+#include "channel-delegator.h"
+
+#include <KDebug>
+
+#include <TelepathyQt/ChannelClassSpec>
+#include <TelepathyQt/TextChannel>
+#include <TelepathyQt/ClientRegistrar>
+
+static inline Tp::ChannelClassSpecList channelClassList()
+{
+    return Tp::ChannelClassSpecList() << Tp::ChannelClassSpec::textChat();
+}
 
 class ConversationsModel::ConversationsModelPrivate
 {
 public:
-    TelepathyTextObserver watcher;
     QList<Conversation*> conversations;
 };
 
-ConversationsModel::ConversationsModel(QObject *parent) :
-        QAbstractListModel(parent),
+ConversationsModel::ConversationsModel() :
+        QAbstractListModel(),
+        Tp::AbstractClientHandler(channelClassList()),
         d(new ConversationsModelPrivate)
 {
     QHash<int, QByteArray> roles;
     roles[ConversationRole] = "conversation";
     setRoleNames(roles);
-
-    QObject::connect(&d->watcher, SIGNAL(newConversation(Conversation*)), SLOT(onInconmingConversation(Conversation*)));
 }
 
 QVariant ConversationsModel::data(const QModelIndex& index, int role) const
@@ -60,32 +68,76 @@ int ConversationsModel::rowCount(const QModelIndex& parent) const
     return d->conversations.count();
 }
 
-void ConversationsModel::onInconmingConversation(Conversation *newConvo)
+void ConversationsModel::handleChannels(const Tp::MethodInvocationContextPtr<> &context,
+                                        const Tp::AccountPtr &account,
+                                        const Tp::ConnectionPtr &connection,
+                                        const QList<Tp::ChannelPtr> &channels,
+                                        const QList<Tp::ChannelRequestPtr> &channelRequests,
+                                        const QDateTime &userActionTime,
+                                        const HandlerInfo &handlerInfo)
 {
-    //check if conversation's channel is already being handled, if so replace it
+    Q_UNUSED(connection);
+    Q_UNUSED(handlerInfo);
+
     bool handled = false;
-    Tp::TextChannelPtr newChannel = newConvo->messages()->textChannel();
-    if (!newChannel->targetHandleType() == Tp::HandleTypeNone) {
-
-        //loop through all conversations checking for matches
-        Q_FOREACH(Conversation *convo, d->conversations) {
-            if (convo->target()->id() == newChannel->targetId() &&
-                    convo->messages()->textChannel()->targetHandleType() == newChannel->targetHandleType()) {
-
-                convo->messages()->setTextChannel(newChannel);
-                newConvo->deleteLater();
-                handled = true;
-                break;
+    bool shouldDelegate = false;
+
+    //check that the channel is of type text
+    Tp::TextChannelPtr textChannel;
+    Q_FOREACH(const Tp::ChannelPtr & channel, channels) {
+        textChannel = Tp::TextChannelPtr::dynamicCast(channel);
+        if (textChannel) {
+            break;
+        }
+    }
+
+    Q_ASSERT(textChannel);
+
+
+    //find the relevant channelRequest
+    Q_FOREACH(const Tp::ChannelRequestPtr channelRequest, channelRequests) {
+        kDebug() << channelRequest->hints().allHints();
+        shouldDelegate = channelRequest->hints().hint(QLatin1String("org.freedesktop.Telepathy.ChannelRequest"), QLatin1String("DelegateToPreferredHandler")).toBool();
+    }
+
+
+    //loop through all conversations checking for matches
+
+    //if we are handling and we're not told to delegate it, update the text channel
+    //if we are handling but should delegate, call delegate channel
+    Q_FOREACH(Conversation *convo, d->conversations) {
+        if (convo->target()->id() == textChannel->targetId() &&
+                convo->messages()->textChannel()->targetHandleType() == textChannel->targetHandleType())
+        {
+            if (!shouldDelegate) {
+                convo->messages()->setTextChannel(textChannel);
+            } else {
+                if (convo->messages()->textChannel() == textChannel) {
+                    ChannelDelegator::delegateChannel(account, textChannel, userActionTime);
+                }
             }
+            handled = true;
+            break;
         }
     }
 
-    if (!handled) {
+    //if we are not handling channel already and should not delegate, add the conversation
+    //if we not handling the channel but should delegate it, do nothing.
+
+    if (!handled && !shouldDelegate) {
         beginInsertRows(QModelIndex(), rowCount(), rowCount());
+        Conversation* newConvo = new Conversation(textChannel, account);
         d->conversations.append(newConvo);
         connect(newConvo, SIGNAL(validityChanged(bool)), SLOT(handleValidityChange(bool)));
         endInsertRows();
+        context->setFinished();
     }
+
+}
+
+bool ConversationsModel::bypassApproval() const
+{
+    return true;
 }
 
 void ConversationsModel::handleValidityChange(bool valid)
diff --git a/plasmoid/declarative-plugin/conversations-model.h b/plasmoid/declarative-plugin/conversations-model.h
index a4c0f03..cf03a74 100644
--- a/plasmoid/declarative-plugin/conversations-model.h
+++ b/plasmoid/declarative-plugin/conversations-model.h
@@ -22,16 +22,18 @@
 
 #include <QAbstractListModel>
 
+#include <TelepathyQt/AbstractClientApprover>
+
 #include "ktpchat_export.h"
 
 
 class Conversation;
 
-class KDE_TELEPATHY_CHAT_EXPORT ConversationsModel : public QAbstractListModel
+class KDE_TELEPATHY_CHAT_EXPORT ConversationsModel : public QAbstractListModel, public Tp::AbstractClientHandler
 {
 Q_OBJECT
 public:
-    explicit ConversationsModel(QObject *parent = 0);
+    explicit ConversationsModel();
     virtual ~ConversationsModel();
 
     virtual QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const;
@@ -41,12 +43,20 @@ public:
         ConversationRole = Qt::UserRole
     };
 
+    void handleChannels(const Tp::MethodInvocationContextPtr<> &context,
+                        const Tp::AccountPtr &account,
+                        const Tp::ConnectionPtr &connection,
+                        const QList<Tp::ChannelPtr> &channels,
+                        const QList<Tp::ChannelRequestPtr> &channelRequests,
+                        const QDateTime &userActionTime,
+                        const HandlerInfo &handlerInfo);
+    bool bypassApproval() const;
+
 private:
     class ConversationsModelPrivate;
     ConversationsModelPrivate *d;
 
 private Q_SLOTS:
-    void onInconmingConversation(Conversation *convo);
     void handleValidityChange(bool);
 };
 
diff --git a/plasmoid/declarative-plugin/messages-model.cpp b/plasmoid/declarative-plugin/messages-model.cpp
index 6cc7c90..0070c83 100644
--- a/plasmoid/declarative-plugin/messages-model.cpp
+++ b/plasmoid/declarative-plugin/messages-model.cpp
@@ -113,7 +113,6 @@ void MessagesModel::setTextChannel(Tp::TextChannelPtr channel)
     }
 
     d->textChannel = channel;
-    Q_EMIT textChannelChanged(d->textChannel);
 
     QList<Tp::ReceivedMessage> messageQueue = channel->messageQueue();
     Q_FOREACH(Tp::ReceivedMessage message, messageQueue) {
@@ -294,15 +293,6 @@ MessagesModel::~MessagesModel()
     delete d;
 }
 
-void MessagesModel::requestClose()
-{
-    kDebug();
-
-    Tp::PendingOperation *op = d->textChannel->requestClose();
-    connect(op, SIGNAL(finished(Tp::PendingOperation*)),
-            SLOT(verifyPendingOperation(Tp::PendingOperation*)));
-}
-
 void MessagesModel::printallmessages()
 {
     Q_FOREACH(MessageItem msg, d->messages) {
diff --git a/plasmoid/declarative-plugin/messages-model.h b/plasmoid/declarative-plugin/messages-model.h
index fe47a00..eeeae20 100644
--- a/plasmoid/declarative-plugin/messages-model.h
+++ b/plasmoid/declarative-plugin/messages-model.h
@@ -54,12 +54,9 @@ public:
     int  unreadCount() const;
     void acknowledgeAllMessages();
 
-    void requestClose();
-
     //debug function. will do whatever I feel like at the time ;-)
     Q_INVOKABLE void printallmessages();
 Q_SIGNALS:
-    void textChannelChanged(Tp::TextChannelPtr newChannel);
     void visibleToUserChanged(bool visible);
 
     void unreadCountChanged(int unreadMesssagesCount);
diff --git a/plasmoid/declarative-plugin/qml-plugins.cpp b/plasmoid/declarative-plugin/qml-plugins.cpp
index 44effae..b570055 100644
--- a/plasmoid/declarative-plugin/qml-plugins.cpp
+++ b/plasmoid/declarative-plugin/qml-plugins.cpp
@@ -32,17 +32,8 @@ void QmlPlugins::registerTypes(const char *uri)
     // this can be used in QML because it spits out Conversations which
     // can be given to ChatWidget.qml
     qmlRegisterType<TelepathyTextObserver> (uri, 0, 1, "TelepathyTextObserver");
-    // is currently instanitized and used by the multi-user plasmoid
-    qmlRegisterType<ConversationsModel>(uri, 0, 1, "ConversationsModel");
-    // isn't instanitized directly, but need to be registered,
-    // because ChatWidget has a property of type Conversation
     qmlRegisterType<Conversation>(uri, 0, 1, "Conversation");
 
-    // these two are used, but not instanitized within QML
-    // and it turns out calling qmlRegisterType with no arguments
-    // allows exactly that
-    qmlRegisterType<ConversationTarget>();
-    qmlRegisterType<MessagesModel> ();
 }
 
 Q_EXPORT_PLUGIN2(conversation, QmlPlugins);
diff --git a/plasmoid/declarative-plugin/telepathy-text-observer.cpp b/plasmoid/declarative-plugin/telepathy-text-observer.cpp
index 58cf736..a1f7ae3 100644
--- a/plasmoid/declarative-plugin/telepathy-text-observer.cpp
+++ b/plasmoid/declarative-plugin/telepathy-text-observer.cpp
@@ -22,58 +22,14 @@
 
 #include <KDebug>
 
-#include <TelepathyQt/ChannelClassSpec>
-#include <TelepathyQt/TextChannel>
+#include <TelepathyQt/AccountFactory>
+#include <TelepathyQt/ConnectionFactory>
 #include <TelepathyQt/ClientRegistrar>
 
 
-static inline Tp::ChannelClassSpecList channelClassList()
-{
-    return Tp::ChannelClassSpecList() << Tp::ChannelClassSpec::textChat();
-}
-
-class TelepathyTextObserver::ConversationClientObserver :
-    public Tp::AbstractClientObserver
-{
-public:
-    virtual void observeChannels(
-        const Tp::MethodInvocationContextPtr<>& context,
-        const Tp::AccountPtr& account,
-        const Tp::ConnectionPtr& connection,
-        const QList< Tp::ChannelPtr >& channels,
-        const Tp::ChannelDispatchOperationPtr& dispatchOperation,
-        const QList< Tp::ChannelRequestPtr >& requestsSatisfied,
-        const Tp::AbstractClientObserver::ObserverInfo& observerInfo)
-    {
-        kDebug();
-
-        //check that the channel is of type text
-        Tp::TextChannelPtr textChannel;
-        Q_FOREACH(const Tp::ChannelPtr & channel, channels) {
-            textChannel = Tp::TextChannelPtr::dynamicCast(channel);
-            if (textChannel) {
-                break;
-            }
-        }
-
-        Q_ASSERT(textChannel);
-
-        Conversation *con = new Conversation(textChannel, account);
-        m_parent->newConversation(con);
-    }
-
-    ConversationClientObserver(TelepathyTextObserver *parent) :
-        AbstractClientObserver(channelClassList()),
-        m_parent(parent)
-    {
-
-    }
-
-    TelepathyTextObserver *m_parent;
-};
-
-TelepathyTextObserver::TelepathyTextObserver() :
-    observer(new ConversationClientObserver(this))
+TelepathyTextObserver::TelepathyTextObserver(QObject* parent) :
+    QObject(parent),
+    m_handler(new ConversationsModel())
 {
     kDebug();
     Tp::registerTypes();
@@ -107,9 +63,16 @@ TelepathyTextObserver::TelepathyTextObserver() :
     //TODO: check these to make sure I'm only requesting features I actually use.
     m_registrar = Tp::ClientRegistrar::create(accountFactory, connectionFactory,
                                             channelFactory, contactFactory);
-    m_registrar->registerClient(observer, QLatin1String("KDE.TextUi.ConversationWatcher"));
+    m_registrar->registerClient(m_handler, QLatin1String("KDE.TextUi.ConversationWatcher")); //KTp.ChatPlasmoid
 }
 
 TelepathyTextObserver::~TelepathyTextObserver()
 {
-}
\ No newline at end of file
+    qDebug() << "deleting text observer";
+}
+
+QAbstractListModel * TelepathyTextObserver::conversationModel()
+{
+    Q_ASSERT(!m_handler.isNull());
+    return m_handler.data();
+}
diff --git a/plasmoid/declarative-plugin/telepathy-text-observer.h b/plasmoid/declarative-plugin/telepathy-text-observer.h
index 6658ee5..241febb 100644
--- a/plasmoid/declarative-plugin/telepathy-text-observer.h
+++ b/plasmoid/declarative-plugin/telepathy-text-observer.h
@@ -22,23 +22,25 @@
 
 #include "ktpchat_export.h"
 
-#include <TelepathyQt/AbstractClient>
+#include "conversations-model.h"
+
+#include <TelepathyQt/AbstractClientHandler>
 
-class Conversation;
 
 class KDE_TELEPATHY_CHAT_EXPORT TelepathyTextObserver : public QObject
 {
 Q_OBJECT
 
+Q_PROPERTY(QObject* conversations READ conversationModel CONSTANT)
+
 public:
-    TelepathyTextObserver();
+    TelepathyTextObserver(QObject* parent=0);
     ~TelepathyTextObserver();
 
-Q_SIGNALS:
-    void newConversation(Conversation *con);
+    QAbstractListModel* conversationModel();
+
 private:
-    class ConversationClientObserver;
-    Tp::SharedPtr<ConversationClientObserver> observer;
+    Tp::SharedPtr<ConversationsModel> m_handler;
     Tp::ClientRegistrarPtr m_registrar;
 };
 
diff --git a/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/ChatWidget.qml b/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/ChatWidget.qml
index 07b67ec..783e127 100644
--- a/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/ChatWidget.qml
+++ b/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/ChatWidget.qml
@@ -8,7 +8,6 @@ Item {
     property Conversation conv
 
     signal closeRequested
-    signal conversationEndRequested
 
     Item {
         id: titleArea
@@ -25,7 +24,7 @@ Item {
             anchors {
                 top: parent.top
                 left: parent.left
-                right: closeButton.left
+                right: popoutButton.left
                 bottom: parent.bottom
             }
 
@@ -34,6 +33,24 @@ Item {
 
             onClicked: closeRequested()
         }
+        
+        PlasmaComponents.ToolButton {
+            id: popoutButton
+
+            anchors {
+                top: parent.top
+                right: closeButton.left
+                bottom: parent.bottom
+            }
+
+            iconSource: "view-conversation-balloon"
+
+            onClicked: {
+                conv.delegateToProperClient();
+                closeRequested();
+            }
+        }
+        
 
         PlasmaComponents.ToolButton {
             id: closeButton
@@ -46,7 +63,7 @@ Item {
 
             iconSource: "dialog-close"
 
-            onClicked: conversationEndRequested()
+            onClicked: conv.requestClose()
         }
     }
 
diff --git a/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/main.qml b/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/main.qml
index 0af180b..0ca90cd 100644
--- a/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/main.qml
+++ b/plasmoid/org.kde.ktp-chatplasmoid/contents/ui/main.qml
@@ -6,14 +6,19 @@ import org.kde.plasma.components 0.1 as PlasmaComponents
 
 
 Item {
+    
+    TelepathyTextObserver {
+        id: main
+    }
+
+    
     id: top
     ListView {
         id: base
         anchors.fill: parent
         orientation: Qt.Horizontal
 
-        model: ConversationsModel {
-        }
+        model: main.conversations
 
         delegate : ConversationDelegate {
             id:conv
@@ -37,14 +42,7 @@ Item {
                     onCloseRequested: {
                         conv.pressed = false;
                     }
-                    onConversationEndRequested: model.conversation.requestClose()
-                    Binding {
-                        target: model.conversation.messages
-                        property: "visibleToUser"
-                        value: dialog.visible
-                    }
                 }
-
             }
 
             Connections {

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list