[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:14 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=d970a6f
The following commit has been merged in the master branch:
commit d970a6f469fb5b9a977708cc652a5defa3cb9197
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Sat Oct 2 14:29:04 2010 +0000
Changed ChatWindow to use d pointers for future binary compatability.
svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1181851
---
lib/chatwindow.cpp | 42 ++++++++++++++++++++++++++++--------------
lib/chatwindow.h | 16 ++++++----------
2 files changed, 34 insertions(+), 24 deletions(-)
diff --git a/lib/chatwindow.cpp b/lib/chatwindow.cpp
index 5a1d1c0..ecdf04f 100644
--- a/lib/chatwindow.cpp
+++ b/lib/chatwindow.cpp
@@ -37,6 +37,16 @@
#include <TelepathyQt4/Message>
#include <TelepathyQt4/Types>
+class ChatWindowPrivate
+{
+public:
+ /** Stores whether the channel is ready with all contacts upgraded*/
+ bool chatviewlInitialised;
+ MessageBoxEventFilter* messageBoxEventFilter;
+ QAction* showFormatToolbarAction;
+ bool isGroupChat;
+};
+
//FIXME once TP::Factory stuff is in, remove all of ChatConnection, replace this with
//ChatWindow::ChatWindow(ConnectionPtr,TextChannelPtr, QWidget* parent) :...
@@ -44,10 +54,13 @@ ChatWindow::ChatWindow(ChatConnection* chat, QWidget *parent) :
QWidget(parent),
ui(new Ui::ChatWindow),
m_chatConnection(chat),
- m_chatviewlInitialised(false),
- m_showFormatToolbarAction(new QAction(i18n("Show format options"), this)),
- m_isGroupChat(false)
+ d(new ChatWindowPrivate)
{
+
+ d->chatviewlInitialised = false;
+ d->showFormatToolbarAction = new QAction(i18n("Show format options"), this);
+ d->isGroupChat = false;
+
ui->setupUi(this);
ui->statusLabel->setText("");
@@ -69,14 +82,14 @@ ChatWindow::ChatWindow(ChatConnection* chat, QWidget *parent) :
updateEnabledState(false);
//format toolbar visibility
- m_showFormatToolbarAction->setCheckable(true);
- connect(m_showFormatToolbarAction, SIGNAL(toggled(bool)), ui->formatToolbar, SLOT(setVisible(bool)));
- ui->sendMessageBox->addAction(m_showFormatToolbarAction);
+ d->showFormatToolbarAction->setCheckable(true);
+ connect(d->showFormatToolbarAction, SIGNAL(toggled(bool)), ui->formatToolbar, SLOT(setVisible(bool)));
+ ui->sendMessageBox->addAction(d->showFormatToolbarAction);
//FIXME load whether to show/hide by default from config file (do per account)
bool formatToolbarIsVisible = false;
ui->formatToolbar->setVisible(formatToolbarIsVisible);
- m_showFormatToolbarAction->setChecked(formatToolbarIsVisible);
+ d->showFormatToolbarAction->setChecked(formatToolbarIsVisible);
//connect signals/slots from format toolbar
connect(ui->formatColor, SIGNAL(released()), SLOT(onFormatColorReleased()));
@@ -95,15 +108,16 @@ ChatWindow::ChatWindow(ChatConnection* chat, QWidget *parent) :
connect(ui->chatArea, SIGNAL(loadFinished(bool)), SLOT(chatViewReady()));
connect(ui->sendMessageBox, SIGNAL(textChanged()), SLOT(onInputBoxChanged()));
- messageBoxEventFilter = new MessageBoxEventFilter(this);
- ui->sendMessageBox->installEventFilter(messageBoxEventFilter);
- connect(messageBoxEventFilter, SIGNAL(returnKeyPressed()), SLOT(sendMessage()));
+ d->messageBoxEventFilter = new MessageBoxEventFilter(this);
+ ui->sendMessageBox->installEventFilter(d->messageBoxEventFilter);
+ connect(d->messageBoxEventFilter, SIGNAL(returnKeyPressed()), SLOT(sendMessage()));
}
ChatWindow::~ChatWindow()
{
delete ui;
+ delete d;
}
void ChatWindow::changeEvent(QEvent *e)
@@ -127,7 +141,7 @@ QString ChatWindow::title()
void ChatWindow::handleIncomingMessage(const Tp::ReceivedMessage &message)
{
- if (m_chatviewlInitialised) {
+ if (d->chatviewlInitialised) {
AdiumThemeContentInfo messageInfo(AdiumThemeMessageInfo::RemoteToLocal);
//debug the message parts (looking for HTML etc)
@@ -171,7 +185,7 @@ void ChatWindow::handleMessageSent(const Tp::Message &message, Tp::MessageSendin
void ChatWindow::chatViewReady()
{
- m_chatviewlInitialised = true;
+ d->chatviewlInitialised = true;
//process any messages we've 'missed' whilst initialising.
foreach(Tp::ReceivedMessage message, m_chatConnection->channel()->messageQueue()) {
@@ -267,7 +281,7 @@ void ChatWindow::onContactPresenceChange(Tp::ContactPtr contact, uint type)
//if in a non-group chat situation, and the other contact has changed state...
- if (! m_isGroupChat && ! isYou)
+ if (! d->isGroupChat && ! isYou)
{
KIcon icon = iconForPresence(type);
Q_EMIT iconChanged(icon);
@@ -304,7 +318,7 @@ void ChatWindow::updateEnabledState(bool enable)
} else {
//some sort of group chat scenario.. Not sure how to create this yet.
info.setChatName("Group Chat");
- m_isGroupChat = true;
+ d->isGroupChat = true;
}
info.setSourceName(m_chatConnection->connection()->protocolName());
diff --git a/lib/chatwindow.h b/lib/chatwindow.h
index dc9c1b6..e42c8e5 100644
--- a/lib/chatwindow.h
+++ b/lib/chatwindow.h
@@ -33,6 +33,8 @@ namespace Ui
class ChatWindow;
}
+class ChatWindowPrivate;
+
class MessageBoxEventFilter : public QObject
{
Q_OBJECT
@@ -101,18 +103,12 @@ private slots:
void onFormatColorReleased();
private:
- Ui::ChatWindow *ui;
- ChatConnection* m_chatConnection;
-
- /** Stores whether the channel is ready with all contacts upgraded*/
- bool m_chatviewlInitialised;
-
KIcon iconForPresence(uint presence);
- MessageBoxEventFilter* messageBoxEventFilter;
- ChannelChatState lastRequestedChannelChatState;
- QAction* m_showFormatToolbarAction;
- bool m_isGroupChat;
+ Ui::ChatWindow *ui;
+ ChatConnection* m_chatConnection; //FIXME deprecate this whole class when factories is finished.
+ ChatWindowPrivate *d;
+
};
#endif // CHATWINDOW_H
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list