Commit b28d9f8e authored by Ronan Abhamon's avatar Ronan Abhamon

unstable

parent 5cfa2c8e
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <QQuickView> #include <QQuickView>
#include <QtDebug> #include <QtDebug>
#include "../components/chat/ChatModel.hpp"
#include "../components/contacts/ContactsListProxyModel.hpp" #include "../components/contacts/ContactsListProxyModel.hpp"
#include "../components/core/CoreManager.hpp" #include "../components/core/CoreManager.hpp"
#include "../components/settings/AccountSettingsModel.hpp" #include "../components/settings/AccountSettingsModel.hpp"
...@@ -70,10 +71,12 @@ void App::initContentApp () { ...@@ -70,10 +71,12 @@ void App::initContentApp () {
} }
void App::registerTypes () { void App::registerTypes () {
// Register meta types.
qmlRegisterUncreatableType<Presence>( qmlRegisterUncreatableType<Presence>(
"Linphone", 1, 0, "Presence", "Presence is uncreatable" "Linphone", 1, 0, "Presence", "Presence is uncreatable"
); );
// Register Application/Core.
qmlRegisterSingletonType<App>( qmlRegisterSingletonType<App>(
"Linphone", 1, 0, "App", "Linphone", 1, 0, "App",
[](QQmlEngine *, QJSEngine *) -> QObject *{ [](QQmlEngine *, QJSEngine *) -> QObject *{
...@@ -88,9 +91,13 @@ void App::registerTypes () { ...@@ -88,9 +91,13 @@ void App::registerTypes () {
} }
); );
// Register models.
ContactsListProxyModel::initContactsListModel(new ContactsListModel()); ContactsListProxyModel::initContactsListModel(new ContactsListModel());
qmlRegisterType<ContactsListProxyModel>("Linphone", 1, 0, "ContactsListProxyModel"); qmlRegisterType<ContactsListProxyModel>("Linphone", 1, 0, "ContactsListProxyModel");
qmlRegisterType<ChatModel>("Linphone", 1, 0, "ChatModel");
// Register singletons.
qmlRegisterSingletonType<ContactsListModel>( qmlRegisterSingletonType<ContactsListModel>(
"Linphone", 1, 0, "ContactsListModel", "Linphone", 1, 0, "ContactsListModel",
[](QQmlEngine *, QJSEngine *) -> QObject *{ [](QQmlEngine *, QJSEngine *) -> QObject *{
......
#include "ChatModel.hpp"
// ===================================================================
ChatModel::ChatModel (QObject *parent) : QObject(parent) {
}
...@@ -8,8 +8,28 @@ ...@@ -8,8 +8,28 @@
class ChatModel : public QObject { class ChatModel : public QObject {
Q_OBJECT; Q_OBJECT;
Q_PROPERTY(
QString remoteSipAddress
READ getRemoteSipAddress
WRITE setRemoteSipAddress
NOTIFY remoteSipAddressChanged
);
public: public:
ChatModel (QObject *parent = Q_NULLPTR); ChatModel (QObject *parent = Q_NULLPTR);
signals:
void remoteSipAddressChanged (QString remote_sip_address);
private:
QString getRemoteSipAddress () const {
return m_remote_sip_address;
}
void setRemoteSipAddress (QString &remote_sip_address) {
m_remote_sip_address = remote_sip_address;
}
QString m_remote_sip_address;
}; };
#endif // CHAT_MODEL_H_ #endif // CHAT_MODEL_H_
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