File indexing completed on 2024-12-29 04:54:49

0001 /*
0002   SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-only
0005 */
0006 
0007 #include "sievetexteditorspellcheckdecorator.h"
0008 #include "sievetextedit.h"
0009 using namespace KSieveUi;
0010 
0011 SieveTextEditorSpellCheckDecorator::SieveTextEditorSpellCheckDecorator(SieveTextEdit *plainTextEdit)
0012     : Sonnet::SpellCheckDecorator(plainTextEdit)
0013     , mPlainTextEdit(plainTextEdit)
0014 {
0015 }
0016 
0017 bool SieveTextEditorSpellCheckDecorator::isSpellCheckingEnabledForBlock(const QString &textBlock) const
0018 {
0019     // allow to spell check comment
0020     return mPlainTextEdit->checkSpellingEnabled() && textBlock.startsWith(QLatin1Char('#'));
0021 }
0022 
0023 #include "moc_sievetexteditorspellcheckdecorator.cpp"