Libksieve

sievetexteditorspellcheckdecorator.cpp
1 /*
2  Copyright (C) 2015-2020 Laurent Montel <[email protected]>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include "sievetextedit.h"
19 #include "sievetexteditorspellcheckdecorator.h"
20 using namespace KSieveUi;
21 
22 SieveTextEditorSpellCheckDecorator::SieveTextEditorSpellCheckDecorator(SieveTextEdit *plainTextEdit)
23  : Sonnet::SpellCheckDecorator(plainTextEdit)
24  , mPlainTextEdit(plainTextEdit)
25 {
26 }
27 
28 bool SieveTextEditorSpellCheckDecorator::isSpellCheckingEnabledForBlock(const QString &textBlock) const
29 {
30  // allow to spell check comment
31  return mPlainTextEdit->checkSpellingEnabled() && textBlock.startsWith(QLatin1Char('#'));
32 }
The SieveTextEdit class.
Definition: sievetextedit.h:33
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 22:46:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.