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

Don't show autospellcheck error during printing

parent b21ba301
......@@ -374,9 +374,12 @@ void SieveEditorTextModeWidget::print()
std::unique_ptr<QPrintDialog> dlg(new QPrintDialog(&printer));
bool restoreSpellCheck = mTextEdit->checkSpellingEnabled();
mTextEdit->setCheckSpellingEnabled(false);
if (dlg && dlg->exec() == QDialog::Accepted) {
mTextEdit->print(&printer);
}
mTextEdit->setCheckSpellingEnabled(restoreSpellCheck);
}
}
......@@ -384,11 +387,14 @@ void SieveEditorTextModeWidget::printPreview()
{
const QWidget *w = mTabWidget->currentWidget();
if (w == mEditorWidget) {
bool restoreSpellCheck = mTextEdit->checkSpellingEnabled();
mTextEdit->setCheckSpellingEnabled(false);
PimCommon::KPimPrintPreviewDialog previewdlg(this);
connect(&previewdlg, &QPrintPreviewDialog::paintRequested, this, [this](QPrinter *printer) {
mTextEdit->print(printer);
});
previewdlg.exec();
mTextEdit->setCheckSpellingEnabled(restoreSpellCheck);
}
}
......
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