File indexing completed on 2025-02-16 04:55:57

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #include "sieveactionreturn.h"
0007 #include "editor/sieveeditorutil.h"
0008 
0009 #include <KLocalizedString>
0010 
0011 using namespace KSieveUi;
0012 SieveActionReturn::SieveActionReturn(SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, QObject *parent)
0013     : SieveAction(sieveGraphicalModeWidget, QStringLiteral("return"), i18n("Return"), parent)
0014 {
0015 }
0016 
0017 QString SieveActionReturn::code(QWidget *) const
0018 {
0019     return QStringLiteral("return;");
0020 }
0021 
0022 QUrl SieveActionReturn::href() const
0023 {
0024     return SieveEditorUtil::helpUrl(SieveEditorUtil::strToVariableName(name()));
0025 }
0026 
0027 QString SieveActionReturn::help() const
0028 {
0029     return i18n(
0030         "The \"return\" command stops processing of the immediately included script only and returns processing control to the script that includes it.");
0031 }
0032 
0033 QStringList SieveActionReturn::needRequires(QWidget * /*parent*/) const
0034 {
0035     return QStringList() << QStringLiteral("include");
0036 }
0037 
0038 bool SieveActionReturn::needCheckIfServerHasCapability() const
0039 {
0040     return true;
0041 }
0042 
0043 QString SieveActionReturn::serverNeedsCapability() const
0044 {
0045     return QStringLiteral("include");
0046 }
0047 
0048 #include "moc_sieveactionreturn.cpp"