Messagelib

scamdetectionwhitelistsettingsmanager.cpp
1 /*
2  SPDX-FileCopyrightText: 2021-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 
6 */
7 #include "scamdetectionwhitelistsettingsmanager.h"
8 
9 #include <KConfigGroup>
10 #include <KSharedConfig>
11 
12 namespace
13 {
14 static const char myScamDetectionWhiteListGroupName[] = "ScamDetectionWhiteList";
15 }
16 using namespace MessageViewer;
17 ScamDetectionWhiteListSettingsManager::ScamDetectionWhiteListSettingsManager(QObject *parent)
18  : QObject{parent}
19 {
20  loadSettings();
21 }
22 
23 ScamDetectionWhiteListSettingsManager::~ScamDetectionWhiteListSettingsManager()
24 {
25  writeSettings();
26 }
27 
28 ScamDetectionWhiteListSettingsManager *ScamDetectionWhiteListSettingsManager::self()
29 {
30  static ScamDetectionWhiteListSettingsManager s_self;
31  return &s_self;
32 }
33 
34 void ScamDetectionWhiteListSettingsManager::loadSettings()
35 {
36  mScamDetectionInfoList.clear();
37  KSharedConfig::Ptr config = KSharedConfig::openConfig();
38  KConfigGroup group(config, myScamDetectionWhiteListGroupName);
39  // TODO
40 }
41 
42 void ScamDetectionWhiteListSettingsManager::writeSettings()
43 {
44  KSharedConfig::Ptr config = KSharedConfig::openConfig();
45  KConfigGroup group(config, myScamDetectionWhiteListGroupName);
46  // TODO
47 }
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
KSharedConfigPtr config()
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat May 21 2022 03:53:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.