[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:20:55 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=39069d6
The following commit has been merged in the master branch:
commit 39069d638e103ae76e083d37a6e00c30dbd80c36
Author: Lasath Fernando <kde at lasath.org>
Date: Sat Jan 14 23:53:59 2012 +1100
Rename Conversation::model to Conversation::messages
And remove useless commented out code.
---
lib/conversation.cpp | 26 ++++++--------------------
lib/conversation.h | 6 +++---
lib/conversations-model.cpp | 6 +++---
plasmoid/contents/ui/ChatWidget.qml | 3 ++-
plasmoid/contents/ui/ConversationDelegate.qml | 12 +-----------
plasmoid/contents/ui/main.qml | 19 +++++++------------
6 files changed, 22 insertions(+), 50 deletions(-)
diff --git a/lib/conversation.cpp b/lib/conversation.cpp
index 5d48948..89cd4e8 100644
--- a/lib/conversation.cpp
+++ b/lib/conversation.cpp
@@ -27,9 +27,8 @@
class Conversation::ConversationPrivate
{
public:
- MessagesModel *model;
+ MessagesModel *messages;
ConversationTarget *target;
-// Tp::AccountPtr account;
};
Conversation::Conversation(const Tp::TextChannelPtr& channel, const Tp::AccountPtr& account, QObject *parent) :
@@ -38,13 +37,10 @@ Conversation::Conversation(const Tp::TextChannelPtr& channel, const Tp::AccountP
{
kDebug();
- d->model = new MessagesModel(this);
- d->model->setTextChannel(channel);
+ d->messages = new MessagesModel(this);
+ d->messages->setTextChannel(channel);
d->target = new ConversationTarget(channel->targetContact(), this);
-
-// connect(model(), SIGNAL(unreadCountChanged(int)), SLOT(onUnreadMessagesChanged()));
-// d->account = account;
}
Conversation::Conversation(QObject *parent) : QObject(parent)
@@ -53,26 +49,16 @@ Conversation::Conversation(QObject *parent) : QObject(parent)
Q_ASSERT(false);
}
-MessagesModel *Conversation::model() const
+MessagesModel* Conversation::messages() const
{
- return d->model;
+ return d->messages;
}
-ConversationTarget *Conversation::target() const
+ConversationTarget* Conversation::target() const
{
return d->target;
}
-// void Conversation::onUnreadMessagesChanged()
-// {
-// enqueSelf();
-// }
-//
-// void Conversation::selfDequed()
-// {
-// Q_EMIT popoutRequested();
-// }
-
Conversation::~Conversation()
{
kDebug();
diff --git a/lib/conversation.h b/lib/conversation.h
index 9538c3f..565b28a 100644
--- a/lib/conversation.h
+++ b/lib/conversation.h
@@ -37,9 +37,9 @@ class KDE_TELEPATHY_CHAT_EXPORT Conversation : public QObject
Q_OBJECT
// Q_PROPERTY(ConversationTarget *target READ target CONSTANT);
-Q_PROPERTY(ConversationTarget *target READ target CONSTANT);
+Q_PROPERTY(ConversationTarget* target READ target CONSTANT);
//TODO: rename this to messages
-Q_PROPERTY(MessagesModel *model READ model CONSTANT);
+Q_PROPERTY(MessagesModel* messages READ messages CONSTANT);
public:
Conversation(const Tp::TextChannelPtr &channel, const Tp::AccountPtr &account, QObject *parent = 0);
@@ -47,7 +47,7 @@ public:
virtual ~Conversation();
//FIXME: rename model to messages
- MessagesModel* model() const;
+ MessagesModel* messages() const;
ConversationTarget* target() const;
private:
diff --git a/lib/conversations-model.cpp b/lib/conversations-model.cpp
index ba2c9eb..332d76a 100644
--- a/lib/conversations-model.cpp
+++ b/lib/conversations-model.cpp
@@ -62,15 +62,15 @@ void ConversationsModel::onInconmingConversation(Conversation *newConvo)
{
//check if conversation's channel is already being handled, if so replace it
bool handled = false;
- Tp::TextChannelPtr newChannel = newConvo->model()->textChannel();
+ 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->model()->textChannel()->targetHandleType() == newChannel->targetHandleType()) {
+ convo->messages()->textChannel()->targetHandleType() == newChannel->targetHandleType()) {
- convo->model()->setTextChannel(newChannel);
+ convo->messages()->setTextChannel(newChannel);
newConvo->deleteLater();
handled = true;
break;
diff --git a/plasmoid/contents/ui/ChatWidget.qml b/plasmoid/contents/ui/ChatWidget.qml
index 042edcc..d592c22 100644
--- a/plasmoid/contents/ui/ChatWidget.qml
+++ b/plasmoid/contents/ui/ChatWidget.qml
@@ -74,6 +74,7 @@ Item {
rightMargin: chatArea.anchors.leftMargin
}
+// contemplating if this makes it look better or worse
// PlasmaComponents.Highlight { anchors.fill: chatArea }
ListView {
@@ -88,7 +89,7 @@ Item {
clip: true
delegate: TextDelegate {}
- model: conv.model
+ model: conv.messages
}
PlasmaComponents.ScrollBar {
diff --git a/plasmoid/contents/ui/ConversationDelegate.qml b/plasmoid/contents/ui/ConversationDelegate.qml
index 3606b3c..75390c2 100644
--- a/plasmoid/contents/ui/ConversationDelegate.qml
+++ b/plasmoid/contents/ui/ConversationDelegate.qml
@@ -15,11 +15,6 @@ Item {
signal toggled
-// Rectangle {
-// anchors.fill: parent
-// color: "blue"
-// }
-
PlasmaCore.FrameSvgItem {
id: canvas
@@ -29,11 +24,8 @@ Item {
anchors.fill: parent
}
- //ise listitem?
PlasmaWidgets.IconWidget {
id: icon
-// text: model.conversation.target.nick
-// icon: model.conversation.target.presenceIcon
anchors.fill: parent
anchors.margins: 5
@@ -78,11 +70,9 @@ Item {
anchors.fill: parent
hoverEnabled: true
+ preventStealing: true
- //move le onClicked into main
onClicked: toggle();
-
- preventStealing: true
}
function toggle() {
diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml
index 0ab068b..2c12a66 100644
--- a/plasmoid/contents/ui/main.qml
+++ b/plasmoid/contents/ui/main.qml
@@ -21,11 +21,7 @@ Item {
anchors.bottom: parent.bottom
image: model.conversation.target.avatar
-// text: model.conversation.target.nick
- overlayText: model.conversation.model.unreadCount
-
-// pressed: model.conversation.model.visibleToUser
-// onClicked: popupApplet();
+ overlayText: model.conversation.messages.unreadCount
//FIXME: put in a loader to not slow down the model
PlasmaCore.Dialog {
@@ -42,20 +38,19 @@ Item {
conv.pressed = false;
}
onConversationEndRequested: {
- model.conversation.model.printallmessages();
+ model.conversation.messages.printallmessages();
}
Binding {
- target: model.conversation.model
+ target: model.conversation.messages
property: "visibleToUser"
value: dialog.visible
}
}
-// x: top.x == top.y ? popupPosition()
}
Connections {
- target: model.conversation.model
+ target: model.conversation.messages
onPopoutRequested: {
conv.pressed = true;
}
@@ -72,7 +67,7 @@ Item {
}
// function popupApplet() {
-// if(model.conversation.model.visibleToUser == false) {
+// if(model.conversation.messages.visibleToUser == false) {
// var point = dialog.popupPosition(conv, Qt.AlignBottom);
// console.log("Showing dialog at (" + point.x + "," + point.y + ")");
//
@@ -80,12 +75,12 @@ Item {
// dialog.y = point.y;
//
// // dialog.visible = true;
-// model.conversation.model.visibleToUser = true;
+// model.conversation.messages.visibleToUser = true;
// } else {
// console.log("height = " + dialog.height);
// console.log("width = " + dialog.width);
// // dialog.visible = false;
-// model.conversation.model.visibleToUser = false;
+// model.conversation.messages.visibleToUser = false;
// }
// }
}
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list