• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff3
  • core
cache.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2009 Frederik Gladhorn <gladhorn@kde.org>
3 Copyright (c) 2010 Matthias Fuchs <mat69@gmx.net>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef CACHE_H
20#define CACHE_H
21
22#include <QtCore/QObject>
23#include <QtCore/QSet>
24
25#include "engine.h"
26#include "entryinternal.h"
27
28namespace KNS3 {
29
30class Cache : public QObject
31{
32 Q_OBJECT
33
34public:
42 static QSharedPointer<Cache> getCache(const QString &appName);
43
44 ~Cache();
45
47 void readRegistry();
49 EntryInternal::List registryForProvider(const QString& providerId);
50
52 void writeRegistry();
53
54 void insertRequest(const KNS3::Provider::SearchRequest&, const KNS3::EntryInternal::List& entries);
55 EntryInternal::List requestFromCache(const KNS3::Provider::SearchRequest&);
56
57public Q_SLOTS:
58 void registerChangedEntry(const KNS3::EntryInternal& entry);
59
60private:
61 Q_DISABLE_COPY(Cache)
62 Cache(const QString& appName);
63
64 // compatibility with KNS2
65 void readKns2MetaFiles();
66
67private:
68 // The file that is used to keep track of downloaded entries
69 QString registryFile;
70
71 // The component name that was used in KNS2 to keep track of .meta files
72 // This is only for compatibility with the former version - KNewStuff2.
73 QString m_kns2ComponentName;
74
75 QSet<EntryInternal> cache;
76 QHash<QString, EntryInternal::List> requestCache;
77};
78
79}
80
81#endif
KNS3::Cache
Definition: cache.h:31
KNS3::Cache::readRegistry
void readRegistry()
Read the installed entries (on startup)
Definition: cache.cpp:58
KNS3::Cache::insertRequest
void insertRequest(const KNS3::Provider::SearchRequest &, const KNS3::EntryInternal::List &entries)
Definition: cache.cpp:233
KNS3::Cache::getCache
static QSharedPointer< Cache > getCache(const QString &appName)
Returns an instance of a shared cache for appName That way it is made sure, that there do not exist d...
Definition: cache.cpp:41
KNS3::Cache::requestFromCache
EntryInternal::List requestFromCache(const KNS3::Provider::SearchRequest &)
Definition: cache.cpp:240
KNS3::Cache::registerChangedEntry
void registerChangedEntry(const KNS3::EntryInternal &entry)
Definition: cache.cpp:228
KNS3::Cache::registryForProvider
EntryInternal::List registryForProvider(const QString &providerId)
All entries that have been installed by a certain provider.
Definition: cache.cpp:187
KNS3::Cache::writeRegistry
void writeRegistry()
Save the list of installed entries.
Definition: cache.cpp:199
KNS3::Cache::~Cache
~Cache()
Definition: cache.cpp:54
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:55
QHash
QList< EntryInternal >
QObject
QSet
entryinternal.h
engine.h
KNS3
Definition: atticaprovider.cpp:36
KNS3::Provider::SearchRequest
used to keep track of a search
Definition: knewstuff3/core/provider.h:64
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal