Libksieve

sieveaction.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 "sieveaction.h"
8 #include "libksieve_debug.h"
9 
10 #include <KLocalizedString>
11 
12 #include "autocreatescripts/sieveeditorgraphicalmodewidget.h"
13 #include <QWidget>
14 #include <QXmlStreamReader>
15 
16 using namespace KSieveUi;
17 
18 SieveAction::SieveAction(SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, const QString &name, const QString &label, QObject *parent)
19  : SieveCommonActionCondition(sieveGraphicalModeWidget, name, label, parent)
20 {
21 }
22 
23 SieveAction::~SieveAction()
24 {
25 }
26 
27 QStringList SieveAction::listOfIncludeFile() const
28 {
29  if (mSieveGraphicalModeWidget) {
30  return mSieveGraphicalModeWidget->listOfIncludeFile();
31  }
32  qCWarning(LIBKSIEVE_LOG) << "SieveAction::listOfIncludeFile Problem during initialize mSieveGraphicalModeWidget ";
33  return {};
34 }
35 
36 void SieveAction::setParamWidgetValue(QXmlStreamReader &n, QWidget *, QString &)
37 {
39 }
40 
41 void SieveAction::unknownTag(const QStringRef &tag, QString &error)
42 {
43  error += i18n("An unknown tag \"%1\" was found during parsing action \"%2\".", *tag.string(), name()) + QLatin1Char('\n');
44 }
45 
46 void SieveAction::unknownTagValue(const QString &tagValue, QString &error)
47 {
48  error += i18n("An unknown tag value \"%1\" was found during parsing action \"%2\".", tagValue, name()) + QLatin1Char('\n');
49 }
50 
51 void SieveAction::tooManyArguments(const QStringRef &tagName, int index, int maxValue, QString &error)
52 {
53  error += i18n("Too many arguments found for \"%1\", max value is %2, number of value found %3 for %4", name(), maxValue, index, *tagName.string())
54  + QLatin1Char('\n');
55 }
56 
57 void SieveAction::serverDoesNotSupportFeatures(const QString &feature, QString &error)
58 {
59  error += i18n("A feature \"%1\" in condition \"%2\" is not supported by server", feature, name()) + QLatin1Char('\n');
60 }
QString name(const QVariant &location)
void skipCurrentElement()
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 Sun Apr 11 2021 23:09:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.