Mailcommon

filterimporterpathcache.cpp
1 /*
2  SPDX-FileCopyrightText: 2017-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "filterimporterpathcache.h"
8 
9 using namespace MailCommon;
10 FilterImporterPathCache::FilterImporterPathCache(QObject *parent)
11  : QObject(parent)
12 {
13 }
14 
15 FilterImporterPathCache::~FilterImporterPathCache() = default;
16 
17 FilterImporterPathCache *FilterImporterPathCache::self()
18 {
19  static FilterImporterPathCache s_self;
20  return &s_self;
21 }
22 
23 int FilterImporterPathCache::count() const
24 {
25  return mFilterCache.count();
26 }
27 
28 void 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 
37 Akonadi::Collection FilterImporterPathCache::convertedFilterPath(const QString &original)
38 {
39  return mFilterCache.value(original);
40 }
41 
42 void FilterImporterPathCache::clear()
43 {
44  mFilterCache.clear();
45 }
const T value(const Key &key) const const
void clear()
QHash::iterator insert(const Key &key, const T &value)
The FilterImporterPathCache class.
bool isEmpty() const const
bool isValid() const
int count(const Key &key) const const
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Oct 1 2022 04:00:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.