Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
e6b0149d
Commit
e6b0149d
authored
3 years ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
conversationmodel: avoid too long titles
jami-client-qt#670
Change-Id: Ifbf8ba04a7a00f583ec0ec932ca07c8e1a9cf4fc
parent
93851248
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/conversationmodel.cpp
+15
-4
15 additions, 4 deletions
src/conversationmodel.cpp
with
15 additions
and
4 deletions
src/conversationmodel.cpp
+
15
−
4
View file @
e6b0149d
...
...
@@ -1041,18 +1041,29 @@ ConversationModel::title(const QString& conversationId) const
}
// NOTE: Do not call any daemon method there as title() is called a lot for drawing
QString
title
;
auto
idx
=
0
;
auto
idx
=
0u
;
auto
others
=
0
;
for
(
const
auto
&
member
:
conversation
.
participants
)
{
QString
name
;
if
(
member
.
uri
==
owner
.
profileInfo
.
uri
)
{
titl
e
+
=
owner
.
accountModel
->
bestNameForAccount
(
owner
.
id
);
nam
e
=
owner
.
accountModel
->
bestNameForAccount
(
owner
.
id
);
}
else
{
titl
e
+
=
owner
.
contactModel
->
bestNameForContact
(
member
.
uri
);
nam
e
=
owner
.
contactModel
->
bestNameForContact
(
member
.
uri
);
}
if
(
title
.
length
()
+
name
.
length
()
>
32
)
{
// Avoid too long titles
others
+=
1
;
continue
;
}
title
+=
name
;
idx
+=
1
;
if
(
idx
!=
conversation
.
participants
.
size
())
{
if
(
idx
!=
conversation
.
participants
.
size
()
||
others
!=
0
)
{
title
+=
", "
;
}
}
if
(
others
!=
0
)
{
title
+=
QString
(
"+ %1"
).
arg
(
others
);
}
return
title
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment