Commit 894899b1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Avoid to duplicate rule

parent 4495c9b3
Pipeline #138876 passed with stage
in 11 minutes and 4 seconds
......@@ -79,7 +79,7 @@ set(LIBKLEO_LIB_VERSION "5.19.40")
set(AKONADI_LIB_VERSION "5.19.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.19.40")
set(KTNEF_LIB_VERSION "5.19.40")
set(MESSAGELIB_LIB_VERSION "5.19.43")
set(MESSAGELIB_LIB_VERSION "5.19.44")
set(AKONADICALENDAR_LIB_VERSION "5.19.40")
set(CALENDAR_UTILS_VERSION "5.19.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.19.40")
......
......@@ -99,11 +99,21 @@ void OpenUrlWithConfigureWidget::slotAddRule()
if (dlg->exec()) {
const OpenUrlWithConfigureCreateWidget::OpenUrlWithInfo info = dlg->info();
if (info.isValid()) {
auto item = new OpenUrlWithConfigureItem(mListWidget);
MessageViewer::OpenWithUrlInfo r;
r.setCommand(info.command);
r.setCommandLine(info.commandLines);
r.setUrl(info.url);
for (int i = 0, total = mListWidget->count(); i < total; ++i) {
OpenUrlWithConfigureItem *item = static_cast<OpenUrlWithConfigureItem *>(mListWidget->item(i));
const MessageViewer::OpenWithUrlInfo openInfo = item->info();
if (openInfo == r) {
KMessageBox::information(this, i18n("Rule already exists."), i18n("Duplicate Rule"));
delete dlg;
return;
}
}
auto item = new OpenUrlWithConfigureItem(mListWidget);
item->setInfo(r);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment