Warning, file /pim/mailcommon/src/util/resourcereadconfigfile.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002   SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "resourcereadconfigfile.h"
0008 
0009 #include <KConfig>
0010 
0011 using namespace MailCommon;
0012 
0013 class MailCommon::ResourceReadConfigFilePrivate
0014 {
0015 public:
0016     ResourceReadConfigFilePrivate() = default;
0017 
0018     ~ResourceReadConfigFilePrivate()
0019     {
0020         delete mConfig;
0021     }
0022 
0023     KConfig *mConfig = nullptr;
0024 };
0025 
0026 ResourceReadConfigFile::ResourceReadConfigFile(const QString &resourceName)
0027     : d(new MailCommon::ResourceReadConfigFilePrivate)
0028 {
0029     d->mConfig = new KConfig(resourceName + QStringLiteral("rc"));
0030 }
0031 
0032 ResourceReadConfigFile::~ResourceReadConfigFile() = default;
0033 
0034 KConfigGroup ResourceReadConfigFile::group(const QString &name) const
0035 {
0036     if (d->mConfig) {
0037         return d->mConfig->group(name);
0038     }
0039     return {};
0040 }