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
0c7387f8
Commit
0c7387f8
authored
Nov 24, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Linphone/Chat): format correcly sections
parent
5f4e3cf3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ChatModel.cpp
tests/src/components/chat/ChatModel.cpp
+4
-4
Chat.qml
tests/ui/modules/Linphone/Chat/Chat.qml
+1
-1
No files found.
tests/src/components/chat/ChatModel.cpp
View file @
0c7387f8
...
@@ -21,10 +21,10 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const {
...
@@ -21,10 +21,10 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const {
return
QVariant
();
return
QVariant
();
switch
(
role
)
{
switch
(
role
)
{
case
:
Roles
::
ChatEntry
case
Roles
:
:
ChatEntry
:
return
QVariant
::
fromValue
(
m_entries
[
row
]);
return
QVariant
::
fromValue
(
m_entries
[
row
]);
case
:
Roles
::
SectionDate
case
Roles
:
:
SectionDate
:
return
QVariant
::
fromValue
(
m_entries
[
row
][
"
sectionDate"
]
);
return
QVariant
::
fromValue
(
m_entries
[
row
][
"
timestamp"
].
toDate
()
);
}
}
return
QVariant
();
return
QVariant
();
...
@@ -58,7 +58,7 @@ void ChatModel::setSipAddress (const QString &sip_address) {
...
@@ -58,7 +58,7 @@ void ChatModel::setSipAddress (const QString &sip_address) {
for
(
auto
&
message
:
chat_room
->
getHistory
(
0
))
{
for
(
auto
&
message
:
chat_room
->
getHistory
(
0
))
{
QVariantMap
map
;
QVariantMap
map
;
map
[
"sectionDate"
]
=
1465389121
;
// UTC format.
map
[
"timestamp"
]
=
QDateTime
::
fromTime_t
(
message
->
getTime
());
map
[
"timestamp"
]
=
QDateTime
::
fromTime_t
(
message
->
getTime
());
map
[
"type"
]
=
"message"
;
map
[
"type"
]
=
"message"
;
map
[
"content"
]
=
Utils
::
linphoneStringToQString
(
map
[
"content"
]
=
Utils
::
linphoneStringToQString
(
...
...
tests/ui/modules/Linphone/Chat/Chat.qml
View file @
0c7387f8
...
@@ -65,7 +65,7 @@ ColumnLayout {
...
@@ -65,7 +65,7 @@ ColumnLayout {
// Cast section to integer because Qt converts the
// Cast section to integer because Qt converts the
// sectionDate in string!!!
// sectionDate in string!!!
text
:
new
Date
(
+
section
).
toLocaleDateString
(
text
:
new
Date
(
section
).
toLocaleDateString
(
Qt
.
locale
(
App
.
locale
())
Qt
.
locale
(
App
.
locale
())
)
)
}
}
...
...
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