Libksieve

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

KDE's Doxygen guidelines are available online.