Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit daa43b44 authored by Laurent Montel's avatar Laurent Montel 😁

Don't try to export filters when we don't have filters.

Fix potential mem leak when we cancel export
parent 1601e2a5
......@@ -741,9 +741,19 @@ void KMFilterDialog::importFilters(MailCommon::FilterImporterExporter::FilterTyp
void KMFilterDialog::slotExportFilters()
{
FilterImporterExporter exporter(this);
bool wasCanceled = false;
const QList<MailFilter *> filters = mFilterList->filtersForSaving(false, wasCanceled);
if (filters.isEmpty()) {
KMessageBox::information(
this,
i18n("Any filter found."));
return;
}
if (wasCanceled) {
qDeleteAll(filters);
return;
}
FilterImporterExporter exporter(this);
exporter.exportFilters(filters);
}
......
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