[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:18:33 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=eae93e5
The following commit has been merged in the master branch:
commit eae93e5cf83615e5180057af457df526190dcfaf
Author: George Kiagiadakis <george.kiagiadakis at collabora.co.uk>
Date: Sun Jan 30 19:15:15 2011 +0200
Remove the now unneeded updateEnabledState() function in ChatWindow.
---
lib/chatwindow.cpp | 99 +++++++++++++++++++++++++-----------------------------
lib/chatwindow.h | 4 +--
2 files changed, 46 insertions(+), 57 deletions(-)
diff --git a/lib/chatwindow.cpp b/lib/chatwindow.cpp
index 2fc06fa..c16bac8 100644
--- a/lib/chatwindow.cpp
+++ b/lib/chatwindow.cpp
@@ -92,11 +92,20 @@ ChatWindow::ChatWindow(const Tp::TextChannelPtr & channel, QWidget *parent)
d(new ChatWindowPrivate)
{
d->channel = channel;
+ init();
+}
+
+ChatWindow::~ChatWindow()
+{
+ delete d;
+}
+
+void ChatWindow::init()
+{
d->chatviewlInitialised = false;
d->showFormatToolbarAction = new QAction(i18n("Show format options"), this);
d->isGroupChat = false;
-
d->ui.setupUi(this);
d->ui.formatColor->setText(QString());
@@ -114,7 +123,41 @@ ChatWindow::ChatWindow(const Tp::TextChannelPtr & channel, QWidget *parent)
d->ui.insertEmoticon->setText(QString());
d->ui.insertEmoticon->setIcon(KIcon("face-smile"));
- updateEnabledState(true); //FIXME
+ //channel is now valid, start keeping track of contacts.
+ ChannelContactList* contactList = new ChannelContactList(d->channel, this);
+ connect(contactList, SIGNAL(contactPresenceChanged(Tp::ContactPtr,uint)),
+ SLOT(onContactPresenceChange(Tp::ContactPtr,uint)));
+
+ AdiumThemeHeaderInfo info;
+ Tp::Contacts allContacts = d->channel->groupContacts();
+ //normal chat - self and one other person.
+ if (allContacts.size() == 2) {
+ //find the other contact which isn't self.
+ foreach(const Tp::ContactPtr & it, allContacts) {
+ if (it == d->channel->groupSelfContact()) {
+ continue;
+ } else {
+ info.setDestinationDisplayName(it->alias());
+ info.setDestinationName(it->id());
+ info.setChatName(it->alias());
+ info.setIncomingIconPath(it->avatarData().fileName);
+ }
+ }
+ } else {
+ //some sort of group chat scenario.. Not sure how to create this yet.
+ info.setChatName("Group Chat");
+ d->isGroupChat = true;
+ }
+
+ info.setSourceName(d->channel->connection()->protocolName());
+
+ //set up anything related to 'self'
+ info.setOutgoingIconPath(d->channel->groupSelfContact()->avatarData().fileName);
+ info.setTimeOpened(QDateTime::currentDateTime());
+ d->ui.chatArea->initialise(info);
+
+ //set the title of this chat.
+ d->title = info.chatName();
//format toolbar visibility
d->showFormatToolbarAction->setCheckable(true);
@@ -149,10 +192,6 @@ ChatWindow::ChatWindow(const Tp::TextChannelPtr & channel, QWidget *parent)
connect(messageBoxEventFilter, SIGNAL(returnKeyPressed()), SLOT(sendMessage()));
}
-ChatWindow::~ChatWindow()
-{
- delete d;
-}
void ChatWindow::changeEvent(QEvent *e)
{
@@ -390,54 +429,6 @@ void ChatWindow::onContactPresenceChange(const Tp::ContactPtr & contact, uint ty
}
}
-void ChatWindow::updateEnabledState(bool enable)
-{
- //update GUI
- d->ui.sendMessageBox->setEnabled(enable);
-
- //set up the initial chat window details.
- if (enable) {
- //channel is now valid, start keeping track of contacts.
- ChannelContactList* contactList = new ChannelContactList(d->channel, this);
- connect(contactList, SIGNAL(contactPresenceChanged(Tp::ContactPtr,uint)),
- SLOT(onContactPresenceChange(Tp::ContactPtr,uint)));
-
- AdiumThemeHeaderInfo info;
- Tp::Contacts allContacts = d->channel->groupContacts();
- //normal chat - self and one other person.
- if (allContacts.size() == 2) {
- //find the other contact which isn't self.
- foreach(const Tp::ContactPtr & it, allContacts) {
- if (it == d->channel->groupSelfContact()) {
- continue;
- } else {
- info.setDestinationDisplayName(it->alias());
- info.setDestinationName(it->id());
- info.setChatName(it->alias());
- info.setIncomingIconPath(it->avatarData().fileName);
- }
- }
- } else {
- //some sort of group chat scenario.. Not sure how to create this yet.
- info.setChatName("Group Chat");
- d->isGroupChat = true;
- }
-
- info.setSourceName(d->channel->connection()->protocolName());
-
- //set up anything related to 'self'
- info.setOutgoingIconPath(d->channel->groupSelfContact()->avatarData().fileName);
- info.setTimeOpened(QDateTime::currentDateTime());
- d->ui.chatArea->initialise(info);
-
- //inform anyone using the class of the new name for this chat.
- d->title = info.chatName();
- Q_EMIT titleChanged(d->title);
- //FIXME emit the correct icon here too
- }
-}
-
-
void ChatWindow::onInputBoxChanged()
{
//if the box is empty
diff --git a/lib/chatwindow.h b/lib/chatwindow.h
index ae49e39..522e611 100644
--- a/lib/chatwindow.h
+++ b/lib/chatwindow.h
@@ -54,9 +54,6 @@ protected slots:
/** send the text in the text area widget to the client handler*/
void sendMessage();
- /** Enable/Disable buttons in the chat window*/
- void updateEnabledState(bool enabled);
-
void onChatStatusChanged(const Tp::ContactPtr & contact, Tp::ChannelChatState state);
void onContactPresenceChange(const Tp::ContactPtr & contact, uint type);
@@ -82,6 +79,7 @@ private slots:
void onFormatColorReleased();
private:
+ void init();
//FIXME this should be in the ktelepathy lib
static KIcon iconForPresence(uint presence);
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list