Libksieve

sievecondition.cpp
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "sievecondition.h"
8 #include "autocreatescripts/sieveeditorgraphicalmodewidget.h"
9 #include "libksieve_debug.h"
10 
11 #include <KLocalizedString>
12 
13 #include <QWidget>
14 
15 using namespace KSieveUi;
16 
17 SieveCondition::SieveCondition(SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, const QString &name, const QString &label, QObject *parent)
18  : SieveCommonActionCondition(sieveGraphicalModeWidget, name, label, parent)
19 {
20 }
21 
22 SieveCondition::~SieveCondition()
23 {
24 }
25 
26 void SieveCondition::setParamWidgetValue(QXmlStreamReader & /*element*/, QWidget * /*parent*/, bool /*notCondition*/, QString & /*error*/)
27 {
28 }
29 
30 void SieveCondition::unknownTag(const QStringRef &tag, QString &error)
31 {
32  error += i18n("Unknown tag \"%1\" during parsing condition \"%2\"", *tag.string(), name()) + QLatin1Char('\n');
33 }
34 
35 void SieveCondition::unknownTagValue(const QString &tagValue, QString &error)
36 {
37  error += i18n("An unknown tag value \"%1\" was found during parsing condition \"%2\".", tagValue, name()) + QLatin1Char('\n');
38 }
39 
40 void SieveCondition::tooManyArguments(const QString &tagName, int index, int maxValue, QString &error)
41 {
42  error += i18n("Too many argument found for \"%1\", max value is %2, number of value found %3 for %4", name(), maxValue, (index + 1), tagName)
43  + QLatin1Char('\n');
44 }
45 
46 void SieveCondition::tooManyArguments(const QStringRef &tagName, int index, int maxValue, QString &error)
47 {
48  tooManyArguments(tagName.toString(), index, maxValue, error);
49 }
50 
51 void SieveCondition::serverDoesNotSupportFeatures(const QString &feature, QString &error)
52 {
53  error += i18n("A feature \"%1\" in condition \"%2\" is not supported by server", feature, name()) + QLatin1Char('\n');
54 }
QString name(const QVariant &location)
QString toString() const const
QString i18n(const char *text, const TYPE &arg...)
const QString * string() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.