diff --git a/src/kleo/expirycheckerconfig.cpp b/src/kleo/expirycheckerconfig.cpp index f6a06ba82..046a44260 100644 --- a/src/kleo/expirycheckerconfig.cpp +++ b/src/kleo/expirycheckerconfig.cpp @@ -1,26 +1,46 @@ /* kleo/expirycheckerconfig.cpp This file is part of libkleopatra, the KDE keymanagement library SPDX-FileCopyrightText: 2023 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #include #include "expirycheckerconfig.h" #include "expirycheckersettings.h" using namespace Kleo; ExpiryCheckerSettings ExpiryCheckerConfig::settings() const { using days = Kleo::chrono::days; return ExpiryCheckerSettings{days{ownKeyThresholdInDays()}, days{otherKeyThresholdInDays()}, days{rootCertificateThresholdInDays()}, days{intermediateCertificateThresholdInDays()}}; } + +const KConfigSkeletonItem *ExpiryCheckerConfig::ownKeyThresholdInDaysItem() const +{ + return findItem(QStringLiteral("ownKeyThresholdInDays")); +} + +const KConfigSkeletonItem *ExpiryCheckerConfig::otherKeyThresholdInDaysItem() const +{ + return findItem(QStringLiteral("otherKeyThresholdInDays")); +} + +const KConfigSkeletonItem *ExpiryCheckerConfig::rootCertificateThresholdInDaysItem() const +{ + return findItem(QStringLiteral("rootCertificateThresholdInDays")); +} + +const KConfigSkeletonItem *ExpiryCheckerConfig::intermediateCertificateThresholdInDaysItem() const +{ + return findItem(QStringLiteral("intermediateCertificateThresholdInDays")); +} diff --git a/src/kleo/expirycheckerconfig.h b/src/kleo/expirycheckerconfig.h index 04a0eef06..46609fa2d 100644 --- a/src/kleo/expirycheckerconfig.h +++ b/src/kleo/expirycheckerconfig.h @@ -1,34 +1,39 @@ /* kleo/expirycheckerconfig.h This file is part of libkleopatra, the KDE keymanagement library SPDX-FileCopyrightText: 2023 g10 Code GmbH SPDX-FileContributor: Ingo Klöcker SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "kleo_export.h" #ifdef KPim5Libkleo_EXPORTS #include #else #include #endif namespace Kleo { class ExpiryCheckerSettings; class KLEO_EXPORT ExpiryCheckerConfig : public Kleo::ExpiryCheckerConfigBase { public: using ExpiryCheckerConfigBase::ExpiryCheckerConfigBase; ExpiryCheckerSettings settings() const; + + const KConfigSkeletonItem *ownKeyThresholdInDaysItem() const; + const KConfigSkeletonItem *otherKeyThresholdInDaysItem() const; + const KConfigSkeletonItem *rootCertificateThresholdInDaysItem() const; + const KConfigSkeletonItem *intermediateCertificateThresholdInDaysItem() const; }; }