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
PIM Messagelib
Commits
b78a3ffc
Commit
b78a3ffc
authored
Feb 11, 2021
by
Laurent Montel
Browse files
Fix isUnique
parent
c9cd360d
Pipeline
#50454
passed with stage
in 41 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messageviewer/src/remote-content/remotecontentconfigurewidget.cpp
View file @
b78a3ffc
...
...
@@ -81,11 +81,19 @@ void RemoteContentConfigureWidget::slotAdd()
QPointer
<
RemoteContentDialog
>
dlg
=
new
RemoteContentDialog
(
this
);
if
(
dlg
->
exec
())
{
const
auto
info
=
dlg
->
info
();
if
(
RemoteContentManager
::
self
()
->
isUnique
(
info
))
{
const
int
count
=
mListWidget
->
count
();
bool
isUnique
=
true
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
const
auto
item
=
mListWidget
->
item
(
i
);
if
(
item
->
text
()
==
info
.
url
())
{
isUnique
=
false
;
KMessageBox
::
error
(
this
,
i18n
(
"An entry already defines this url. Please modify it."
),
i18n
(
"Add new Url"
));
break
;
}
}
if
(
isUnique
)
{
RemoteContentManager
::
self
()
->
addRemoteContent
(
info
);
insertRemoteContentInfo
(
info
);
}
else
{
KMessageBox
::
error
(
this
,
i18n
(
"An entry already defines this url. Please modify it."
),
i18n
(
"Add new Url"
));
}
}
delete
dlg
;
...
...
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