KNewStuff

cache.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
3 SPDX-FileCopyrightText: 2010 Matthias Fuchs <mat69@gmx.net>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#include "cache.h"
9
10#include "cache2_p.h"
11#include "compat_p.h"
12
13class KNSCore::CachePrivate
14{
15public:
17};
18
19using namespace KNSCore;
20
21Cache::Cache(const QString &appName)
22 : QObject(nullptr)
23 , d(new CachePrivate(Cache2::getCache(appName)))
24{
25}
26
27QSharedPointer<Cache> Cache::getCache(const QString &appName)
28{
29 return QSharedPointer<Cache>(new Cache(appName)); // internally this hits the cache2 registry
30}
31
32Cache::~Cache() = default;
33
34void Cache::readRegistry()
35{
36 d->cache2->readRegistry();
37}
38
39Entry::List Cache::registryForProvider(const QString &providerId)
40{
41 return d->cache2->registryForProvider(providerId);
42}
43
44Entry::List Cache::registry() const
45{
46 return d->cache2->registry();
47}
48
49void Cache::writeRegistry()
50{
51 d->cache2->writeRegistry();
52}
53
54void Cache::registerChangedEntry(const KNSCore::Entry &entry)
55{
56 d->cache2->registerChangedEntry(entry);
57}
58
59void Cache::insertRequest(const KNSCore::Provider::SearchRequest &request, const KNSCore::Entry::List &entries)
60{
61 d->cache2->insertRequest(KNSCompat::searchRequestFromLegacy(request), entries);
62}
63
64Entry::List Cache::requestFromCache(const KNSCore::Provider::SearchRequest &request)
65{
66 return d->cache2->requestFromCache(KNSCompat::searchRequestFromLegacy(request));
67}
68
69void KNSCore::Cache::removeDeletedEntries()
70{
71 d->cache2->removeDeletedEntries();
72}
73
74KNSCore::Entry KNSCore::Cache::entryFromInstalledFile(const QString &installedFile) const
75{
76 return d->cache2->entryFromInstalledFile(installedFile);
77}
78
79#include "moc_cache.cpp"
KNewStuff data entry container.
Definition entry.h:48
QCA_EXPORT QString appName()
used to keep track of a search
Definition provider.h:77
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:13:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.