Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
b28d9f8e
Commit
b28d9f8e
authored
Nov 24, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unstable
parent
5cfa2c8e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
App.cpp
tests/src/app/App.cpp
+7
-0
ChatModel.cpp
tests/src/components/chat/ChatModel.cpp
+6
-0
ChatModel.hpp
tests/src/components/chat/ChatModel.hpp
+20
-0
No files found.
tests/src/app/App.cpp
View file @
b28d9f8e
...
...
@@ -4,6 +4,7 @@
#include <QQuickView>
#include <QtDebug>
#include "../components/chat/ChatModel.hpp"
#include "../components/contacts/ContactsListProxyModel.hpp"
#include "../components/core/CoreManager.hpp"
#include "../components/settings/AccountSettingsModel.hpp"
...
...
@@ -70,10 +71,12 @@ void App::initContentApp () {
}
void
App
::
registerTypes
()
{
// Register meta types.
qmlRegisterUncreatableType
<
Presence
>
(
"Linphone"
,
1
,
0
,
"Presence"
,
"Presence is uncreatable"
);
// Register Application/Core.
qmlRegisterSingletonType
<
App
>
(
"Linphone"
,
1
,
0
,
"App"
,
[](
QQmlEngine
*
,
QJSEngine
*
)
->
QObject
*
{
...
...
@@ -88,9 +91,13 @@ void App::registerTypes () {
}
);
// Register models.
ContactsListProxyModel
::
initContactsListModel
(
new
ContactsListModel
());
qmlRegisterType
<
ContactsListProxyModel
>
(
"Linphone"
,
1
,
0
,
"ContactsListProxyModel"
);
qmlRegisterType
<
ChatModel
>
(
"Linphone"
,
1
,
0
,
"ChatModel"
);
// Register singletons.
qmlRegisterSingletonType
<
ContactsListModel
>
(
"Linphone"
,
1
,
0
,
"ContactsListModel"
,
[](
QQmlEngine
*
,
QJSEngine
*
)
->
QObject
*
{
...
...
tests/src/components/chat/ChatModel.cpp
View file @
b28d9f8e
#include "ChatModel.hpp"
// ===================================================================
ChatModel
::
ChatModel
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
tests/src/components/chat/ChatModel.hpp
View file @
b28d9f8e
...
...
@@ -8,8 +8,28 @@
class
ChatModel
:
public
QObject
{
Q_OBJECT
;
Q_PROPERTY
(
QString
remoteSipAddress
READ
getRemoteSipAddress
WRITE
setRemoteSipAddress
NOTIFY
remoteSipAddressChanged
);
public:
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_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment