File indexing completed on 2024-06-23 05:13:38

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     commands/clearcrlcachecommand.cpp
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #include <config-kleopatra.h>
0011 
0012 #include "clearcrlcachecommand.h"
0013 #include <Libkleo/GnuPG>
0014 
0015 #include <KLocalizedString>
0016 
0017 using namespace Kleo;
0018 using namespace Kleo::Commands;
0019 
0020 ClearCrlCacheCommand::ClearCrlCacheCommand(KeyListController *c)
0021     : GnuPGProcessCommand(c)
0022 {
0023 }
0024 
0025 ClearCrlCacheCommand::ClearCrlCacheCommand(QAbstractItemView *v, KeyListController *c)
0026     : GnuPGProcessCommand(v, c)
0027 {
0028 }
0029 
0030 ClearCrlCacheCommand::~ClearCrlCacheCommand()
0031 {
0032 }
0033 
0034 QStringList ClearCrlCacheCommand::arguments() const
0035 {
0036     return {gpgSmPath(), QStringLiteral("--call-dirmngr"), QStringLiteral("flushcrls")};
0037 }
0038 
0039 QString ClearCrlCacheCommand::errorCaption() const
0040 {
0041     return i18nc("@title:window", "Clear CRL Cache Error");
0042 }
0043 
0044 QString ClearCrlCacheCommand::successCaption() const
0045 {
0046     return i18nc("@title:window", "Clear CRL Cache Finished");
0047 }
0048 
0049 QString ClearCrlCacheCommand::crashExitMessage(const QStringList &args) const
0050 {
0051     return i18n(
0052         "The DirMngr process that tried to clear the CRL cache "
0053         "ended prematurely because of an unexpected error. "
0054         "Please check the output of %1 for details.",
0055         args.join(QLatin1Char(' ')));
0056 }
0057 
0058 QString ClearCrlCacheCommand::errorExitMessage(const QStringList &args) const
0059 {
0060     return i18n(
0061         "An error occurred while trying to clear the CRL cache. "
0062         "The output from %1 was:\n%2",
0063         args[0],
0064         errorString());
0065 }
0066 
0067 QString ClearCrlCacheCommand::successMessage(const QStringList &) const
0068 {
0069     return i18n("CRL cache cleared successfully.");
0070 }
0071 
0072 #include "moc_clearcrlcachecommand.cpp"