Mailcommon

filterimporterpathcache.cpp
1/*
2 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "filterimporterpathcache.h"
8
9using namespace MailCommon;
10FilterImporterPathCache::FilterImporterPathCache(QObject *parent)
11 : QObject(parent)
12{
13}
14
15FilterImporterPathCache::~FilterImporterPathCache() = default;
16
17FilterImporterPathCache *FilterImporterPathCache::self()
18{
19 static FilterImporterPathCache s_self;
20 return &s_self;
21}
22
23int FilterImporterPathCache::count() const
24{
25 return mFilterCache.count();
26}
27
28void FilterImporterPathCache::insert(const QString &original, const Akonadi::Collection &newValue)
29{
30 if (original.isEmpty() || !newValue.isValid()) {
31 return;
32 }
33
34 mFilterCache.insert(original, newValue);
35}
36
37Akonadi::Collection FilterImporterPathCache::convertedFilterPath(const QString &original)
38{
39 return mFilterCache.value(original);
40}
41
42void FilterImporterPathCache::clear()
43{
44 mFilterCache.clear();
45}
46
47#include "moc_filterimporterpathcache.cpp"
bool isValid() const
The FilterImporterPathCache class.
The filter dialog.
void clear()
qsizetype count() const const
iterator insert(const Key &key, const T &value)
T value(const Key &key) const const
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.