Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Add-ons
Commits
35bfe306
Commit
35bfe306
authored
Aug 19, 2022
by
Laurent Montel
Browse files
Fix show duplicate name
parent
c1ee5b5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
kaddressbook/plugins/mergelib/searchduplicate/resultduplicatetreewidget.cpp
View file @
35bfe306
...
...
@@ -74,7 +74,7 @@ void ResultDuplicateTreeWidget::setContacts(const QVector<Akonadi::Item::List> &
int
i
=
1
;
for
(
const
Akonadi
::
Item
::
List
&
lst
:
lstItem
)
{
auto
topLevelItem
=
new
ResultDuplicateTreeWidgetItem
(
this
);
topLevelItem
->
setText
(
0
,
i18n
(
"Duplicate contact
%1"
,
i
));
topLevelItem
->
setText
(
0
,
i18n
(
"Duplicate contact
\"
%1
\"
"
,
ResultDuplicateTreeWidgetItem
::
displayName
(
lst
.
first
())
));
for
(
const
Akonadi
::
Item
&
item
:
lst
)
{
auto
childItem
=
new
ResultDuplicateTreeWidgetItem
;
topLevelItem
->
addChild
(
childItem
);
...
...
@@ -143,7 +143,15 @@ QString ResultDuplicateTreeWidgetItem::contactName(const KContacts::Addressee &a
void
ResultDuplicateTreeWidgetItem
::
setDisplayName
()
{
if
(
mItem
.
isValid
())
{
const
auto
address
=
mItem
.
payload
<
KContacts
::
Addressee
>
();
setText
(
0
,
contactName
(
address
));
setText
(
0
,
displayName
(
mItem
));
}
}
QString
ResultDuplicateTreeWidgetItem
::
displayName
(
const
Akonadi
::
Item
&
item
)
{
if
(
item
.
isValid
())
{
const
auto
address
=
item
.
payload
<
KContacts
::
Addressee
>
();
return
contactName
(
address
);
}
return
{};
}
kaddressbook/plugins/mergelib/searchduplicate/resultduplicatetreewidget.h
View file @
35bfe306
...
...
@@ -24,9 +24,11 @@ public:
Q_REQUIRED_RESULT
Akonadi
::
Item
item
()
const
;
void
setItem
(
const
Akonadi
::
Item
&
item
);
Q_REQUIRED_RESULT
static
QString
displayName
(
const
Akonadi
::
Item
&
item
);
private:
void
setDisplayName
();
Q_REQUIRED_RESULT
QString
contactName
(
const
KContacts
::
Addressee
&
address
);
Q_REQUIRED_RESULT
static
QString
contactName
(
const
KContacts
::
Addressee
&
address
);
Akonadi
::
Item
mItem
;
};
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment