Commit dc8a0980 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Fix build and minor coding style issues

parent bf06a93f
......@@ -30,24 +30,22 @@
class ContactList : public QObject
{
Q_OBJECT
public:
Q_PROPERTY(QObject* model READ flatModel CONSTANT)
Q_PROPERTY(QObject* filter READ filterModel CONSTANT)
public:
ContactList(QObject *parent=0);
FlatModelProxy* flatModel() const;
AccountsFilterModel* filterModel() const;
public slots:
public Q_SLOTS:
void startChat(const Tp::AccountPtr &account, const Tp::ContactPtr &contact);
private slots:
private Q_SLOTS:
void onAccountManagerReady(Tp::PendingOperation *op);
void onGenericOperationFinished(Tp::PendingOperation *op);
private:
private:
ContactsModel* m_contactsModel;
AccountsFilterModel* m_filterModel;
FlatModelProxy* m_flatModel;
......
......@@ -23,7 +23,7 @@
class ConversationTarget::ConversationTargetPrivate
{
public:
public:
Tp::ContactPtr contact;
KIcon avatar;
};
......
......@@ -25,10 +25,7 @@
#include <TelepathyQt/Contact>
#include "ktpchat_export.h"
class KDE_TELEPATHY_CHAT_EXPORT ConversationTarget : public QObject
class ConversationTarget : public QObject
{
Q_OBJECT
......@@ -38,7 +35,7 @@ class KDE_TELEPATHY_CHAT_EXPORT ConversationTarget : public QObject
Q_PROPERTY(QString presenceIconName READ presenceIconName NOTIFY presenceIconNameChanged)
Q_PROPERTY(QString id READ id)
public:
public:
explicit ConversationTarget(const Tp::ContactPtr &contact, QObject *parent = 0);
virtual ~ConversationTarget();
......@@ -50,18 +47,17 @@ public:
Tp::ContactPtr contact() const;
Q_SIGNALS:
Q_SIGNALS:
void avatarChanged(QIcon avatar);
void nickChanged(QString nick);
void presenceIconChanged(QIcon icon);
void presenceIconNameChanged(QString icon);
private Q_SLOTS:
private Q_SLOTS:
void onAvatarDataChanged(const Tp::AvatarData&);
void onPresenceChanged(const Tp::Presence&);
private:
private:
void setupContactSignals(Tp::ContactPtr contact);
void updateAvatar();
......
......@@ -29,7 +29,7 @@
class Conversation::ConversationPrivate
{
public:
public:
MessagesModel *messages;
ConversationTarget *target;
bool valid;
......
......@@ -20,8 +20,6 @@
#ifndef CONVERSATION_H
#define CONVERSATION_H
#include "ktpchat_export.h"
#include <QObject>
#include <TelepathyQt/Account>
#include <TelepathyQt/TextChannel>
......@@ -34,15 +32,15 @@
class ConversationTarget;
class MessagesModel;
class KDE_TELEPATHY_CHAT_EXPORT Conversation : public QObject
class Conversation : public QObject
{
Q_OBJECT
Q_OBJECT
Q_PROPERTY(QObject* target READ target CONSTANT);
Q_PROPERTY(QObject* messages READ messages CONSTANT);
Q_PROPERTY(bool valid READ isValid NOTIFY validityChanged);
Q_PROPERTY(QObject* target READ target CONSTANT);
Q_PROPERTY(QObject* messages READ messages CONSTANT);
Q_PROPERTY(bool valid READ isValid NOTIFY validityChanged);
public:
public:
Conversation(const Tp::TextChannelPtr &channel, const Tp::AccountPtr &account, QObject *parent = 0);
Conversation(QObject *parent = 0);
virtual ~Conversation();
......@@ -52,17 +50,17 @@ public:
bool isValid();
Q_SIGNALS:
Q_SIGNALS:
void validityChanged(bool isValid);
public Q_SLOTS:
public Q_SLOTS:
void delegateToProperClient();
void requestClose();
private Q_SLOTS:
private Q_SLOTS:
void onChannelInvalidated(Tp::DBusProxy *proxy, const QString &errorName, const QString &errorMessage);
private:
private:
class ConversationPrivate;
ConversationPrivate *d;
};
......
......@@ -36,7 +36,7 @@ static inline Tp::ChannelClassSpecList channelClassList()
class ConversationsModel::ConversationsModelPrivate
{
public:
public:
QList<Conversation*> conversations;
};
......
......@@ -24,15 +24,13 @@
#include <TelepathyQt/AbstractClientApprover>
#include "ktpchat_export.h"
class Conversation;
class KDE_TELEPATHY_CHAT_EXPORT ConversationsModel : public QAbstractListModel, public Tp::AbstractClientHandler
class ConversationsModel : public QAbstractListModel, public Tp::AbstractClientHandler
{
Q_OBJECT
public:
Q_OBJECT
public:
explicit ConversationsModel(QObject *parent);
virtual ~ConversationsModel();
......@@ -52,11 +50,11 @@ public:
const HandlerInfo &handlerInfo);
bool bypassApproval() const;
private:
private:
class ConversationsModelPrivate;
ConversationsModelPrivate *d;
private Q_SLOTS:
private Q_SLOTS:
void handleValidityChange(bool);
};
......
......@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "hidewindowcomponent.h"
#include "hide-window-component.h"
#include <kwindowsystem.h>
#include <QDebug>
......
......@@ -29,10 +29,10 @@
class HideWindowComponent : public QObject
{
Q_OBJECT
public:
explicit HideWindowComponent(QObject* parent = 0);
Q_SCRIPTABLE void hideWindowFromTaskbar(qulonglong winId);
public:
explicit HideWindowComponent(QObject* parent = 0);
Q_SCRIPTABLE void hideWindowFromTaskbar(qulonglong winId);
};
#endif // HIDEWINDOWCOMPONENT_H
......@@ -24,11 +24,11 @@
#include <TelepathyQt/ReceivedMessage>
#include "lib/message-processor.h"
#include "message-processor.h"
class MessageItem
{
public:
public:
QString user;
QString text;
QDateTime time;
......@@ -45,7 +45,7 @@ public:
class MessagesModel::MessagesModelPrivate
{
public:
public:
Tp::TextChannelPtr textChannel;
QList<MessageItem> messages;
bool visible;
......@@ -140,7 +140,7 @@ void MessagesModel::onMessageReceived(const Tp::ReceivedMessage &message)
d->messages.append(MessageItem(
message.sender()->alias(),
MessageProcessor::instance()->processIncomingMessage(message).finalizedMessage(),
KTp::MessageProcessor::instance()->processIncomingMessage(message).finalizedMessage(),
message.received(),
message.messageType() == Tp::ChannelTextMessageTypeAction ? MessageTypeAction : MessageTypeIncoming,
message.messageToken()
......@@ -169,7 +169,7 @@ void MessagesModel::onMessageSent(const Tp::Message &message, Tp::MessageSending
d->messages.append(MessageItem(
i18n("Me"), //FIXME : use actual nickname from Tp::AccountPtr
MessageProcessor::instance()->processOutgoingMessage(message).finalizedMessage(),
KTp::MessageProcessor::instance()->processOutgoingMessage(message).finalizedMessage(),
message.sent(),
message.messageType() == Tp::ChannelTextMessageTypeAction ? MessageTypeAction : MessageTypeOutgoing,
message.messageToken()
......
......@@ -32,7 +32,7 @@ class MessagesModel : public QAbstractListModel, public Queueable
Q_PROPERTY(bool visibleToUser READ isVisibleToUser WRITE setVisibleToUser NOTIFY visibleToUserChanged);
Q_PROPERTY(int unreadCount READ unreadCount NOTIFY unreadCountChanged);
public:
public:
MessagesModel(QObject *parent = 0);
virtual ~MessagesModel();
......@@ -64,25 +64,26 @@ public:
//debug function. will do whatever I feel like at the time ;-)
Q_INVOKABLE void printallmessages();
Q_SIGNALS:
Q_SIGNALS:
void visibleToUserChanged(bool visible);
void unreadCountChanged(int unreadMesssagesCount);
void popoutRequested();
public Q_SLOTS:
public Q_SLOTS:
void sendNewMessage(const QString& message);
private Q_SLOTS:
private Q_SLOTS:
void onMessageReceived(const Tp::ReceivedMessage &message);
void onMessageSent(const Tp::Message &message, Tp::MessageSendingFlags flags, const QString &messageToken);
void onPendingMessageRemoved();
bool verifyPendingOperation(Tp::PendingOperation *op);
private:
private:
void setupChannelSignals(const Tp::TextChannelPtr &channel);
void removeChannelSignals(const Tp::TextChannelPtr &channel);
virtual void selfDequed();
virtual void selfDequeued();
class MessagesModelPrivate;
MessagesModelPrivate *d;
......
......@@ -20,26 +20,24 @@
#ifndef TELEPATHY_TEXT_OBSERVER_H
#define TELEPATHY_TEXT_OBSERVER_H
#include "ktpchat_export.h"
#include "conversations-model.h"
#include <TelepathyQt/AbstractClientHandler>
class KDE_TELEPATHY_CHAT_EXPORT TelepathyTextObserver : public QObject
class TelepathyTextObserver : public QObject
{
Q_OBJECT
Q_OBJECT
Q_PROPERTY(QObject* conversations READ conversationModel CONSTANT)
Q_PROPERTY(QObject* conversations READ conversationModel CONSTANT)
public:
public:
TelepathyTextObserver(QObject* parent=0);
~TelepathyTextObserver();
QAbstractListModel* conversationModel();
private:
private:
Tp::SharedPtr<ConversationsModel> m_handler;
Tp::ClientRegistrarPtr m_registrar;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment