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

KNewStuff

  • knewstuff
  • knewstuff3
  • core
knewstuff3/core/engine.cpp
Go to the documentation of this file.
1/*
2 knewstuff3/engine.cpp
3 Copyright (c) 2007 Josef Spillner <spillner@kde.org>
4 Copyright (C) 2007-2010 Frederik Gladhorn <gladhorn@kde.org>
5 Copyright (c) 2009 Jeremy Whiting <jpwhiting@kde.org>
6 Copyright (c) 2010 Matthias Fuchs <mat69@gmx.net>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include "engine.h"
23
24#include "entry.h"
25#include "core/installation.h"
26#include "core/xmlloader.h"
27#include "ui/imageloader.h"
28
29#include <kaboutdata.h>
30#include <kconfig.h>
31#include <kconfiggroup.h>
32#include <kcomponentdata.h>
33#include <kdebug.h>
34#include <kstandarddirs.h>
35#include <kcodecs.h>
36#include <kprocess.h>
37#include <kshell.h>
38
39#include <kio/job.h>
40#include <kmimetype.h>
41#include <krandom.h>
42#include <ktoolinvocation.h>
43
44#include <QtCore/QTimer>
45#include <QtCore/QDir>
46#include <QtXml/qdom.h>
47#include <QtCore/Q_PID>
48
49#if defined(Q_OS_WIN)
50#include <windows.h>
51#define _WIN32_IE 0x0500
52#include <shlobj.h>
53#endif
54
55// libattica
56#include <attica/providermanager.h>
57
58// own
59#include "attica/atticaprovider.h"
60#include "core/cache.h"
61#include "staticxml/staticxmlprovider.h"
62
63using namespace KNS3;
64
65Engine::Engine(QObject* parent)
66 : QObject(parent)
67 , m_initialized(false)
68 , m_installation(new Installation)
69 , m_cache(0)
70 , m_searchTimer(new QTimer)
71 , m_currentPage(-1)
72 , m_pageSize(20)
73 , m_numDataJobs(0)
74 , m_numPictureJobs(0)
75 , m_numInstallJobs(0)
76 , m_atticaProviderManager(0)
77{
78 m_searchTimer->setSingleShot(true);
79 m_searchTimer->setInterval(1000);
80 connect(m_searchTimer, SIGNAL(timeout()), SLOT(slotSearchTimerExpired()));
81 connect(m_installation, SIGNAL(signalInstallationFinished()), this, SLOT(slotInstallationFinished()));
82 connect(m_installation, SIGNAL(signalInstallationFailed(QString)), this, SLOT(slotInstallationFailed(QString)));
83
84}
85
86Engine::~Engine()
87{
88 if (m_cache) {
89 m_cache->writeRegistry();
90 }
91 delete m_atticaProviderManager;
92 delete m_searchTimer;
93 delete m_installation;
94}
95
96bool Engine::init(const QString &configfile)
97{
98 kDebug() << "Initializing KNS3::Engine from '" << configfile << "'";
99
100 emit signalBusy(i18n("Initializing"));
101
102 KConfig conf(configfile);
103 if (conf.accessMode() == KConfig::NoAccess) {
104 emit signalError(i18n("Configuration file not found: \"%1\"", configfile));
105 kError() << "No knsrc file named '" << configfile << "' was found." << endl;
106 return false;
107 }
108 // FIXME: accessMode() doesn't return NoAccess for non-existing files
109 // - bug in kdecore?
110 // - this needs to be looked at again until KConfig backend changes for KDE 4
111 // the check below is a workaround
112 if (KStandardDirs::locate("config", configfile).isEmpty()) {
113 emit signalError(i18n("Configuration file not found: \"%1\"", configfile));
114 kError() << "No knsrc file named '" << configfile << "' was found." << endl;
115 return false;
116 }
117
118 KConfigGroup group;
119 if (conf.hasGroup("KNewStuff3")) {
120 kDebug() << "Loading KNewStuff3 config: " << configfile;
121 group = conf.group("KNewStuff3");
122 } else if (conf.hasGroup("KNewStuff2")) {
123 kDebug() << "Loading KNewStuff2 config: " << configfile;
124 group = conf.group("KNewStuff2");
125 } else {
126 emit signalError(i18n("Configuration file is invalid: \"%1\"", configfile));
127 kError() << "A knsrc file was found but it doesn't contain a KNewStuff3 section." << endl;
128 return false;
129 }
130
131 m_categories = group.readEntry("Categories", QStringList());
132
133 kDebug() << "Categories: " << m_categories;
134 m_providerFileUrl = group.readEntry("ProvidersUrl", QString());
135 m_applicationName = QFileInfo(KStandardDirs::locate("config", configfile)).baseName() + ':';
136
137 // let installation read install specific config
138 if (!m_installation->readConfig(group)) {
139 return false;
140 }
141
142 connect(m_installation, SIGNAL(signalEntryChanged(KNS3::EntryInternal)), SLOT(slotEntryChanged(KNS3::EntryInternal)));
143
144 m_cache = Cache::getCache(m_applicationName.split(':')[0]);
145 connect(this, SIGNAL(signalEntryChanged(KNS3::EntryInternal)), m_cache.data(), SLOT(registerChangedEntry(KNS3::EntryInternal)));
146 m_cache->readRegistry();
147
148 m_initialized = true;
149
150 // load the providers
151 loadProviders();
152
153 return true;
154}
155
156QStringList Engine::categories() const
157{
158 return m_categories;
159}
160
161QStringList Engine::categoriesFilter() const
162{
163 return m_currentRequest.categories;
164}
165
166void Engine::loadProviders()
167{
168 if (m_providerFileUrl.isEmpty()) {
169 // it would be nicer to move the attica stuff into its own class
170 kDebug(550) << "Using OCS default providers";
171 Attica::ProviderManager* m_atticaProviderManager = new Attica::ProviderManager;
172 connect(m_atticaProviderManager, SIGNAL(providerAdded(Attica::Provider)), this, SLOT(atticaProviderLoaded(Attica::Provider)));
173 m_atticaProviderManager->loadDefaultProviders();
174 } else {
175 kDebug(550) << "loading providers from " << m_providerFileUrl;
176 emit signalBusy(i18n("Loading provider information"));
177
178 XmlLoader * loader = new XmlLoader(this);
179 connect(loader, SIGNAL(signalLoaded(QDomDocument)), SLOT(slotProviderFileLoaded(QDomDocument)));
180 connect(loader, SIGNAL(signalFailed()), SLOT(slotProvidersFailed()));
181
182 loader->load(KUrl(m_providerFileUrl));
183 }
184}
185
186void Engine::slotProviderFileLoaded(const QDomDocument& doc)
187{
188 kDebug() << "slotProvidersLoaded";
189
190 bool isAtticaProviderFile = false;
191
192 // get each provider element, and create a provider object from it
193 QDomElement providers = doc.documentElement();
194
195 if (providers.tagName() == "providers") {
196 isAtticaProviderFile = true;
197 } else if (providers.tagName() != "ghnsproviders" && providers.tagName() != "knewstuffproviders") {
198 kWarning(550) << "No document in providers.xml.";
199 emit signalError(i18n("Could not load get hot new stuff providers from file: %1", m_providerFileUrl));
200 return;
201 }
202
203 QDomElement n = providers.firstChildElement("provider");
204 while (!n.isNull()) {
205 kDebug() << "Provider attributes: " << n.attribute("type");
206
207 QSharedPointer<KNS3::Provider> provider;
208 if (isAtticaProviderFile || n.attribute("type").toLower() == "rest") {
209 provider = QSharedPointer<KNS3::Provider> (new AtticaProvider(m_categories));
210 } else {
211 provider = QSharedPointer<KNS3::Provider> (new StaticXmlProvider);
212 }
213
214 if (provider->setProviderXML(n)) {
215 addProvider(provider);
216 } else {
217 emit signalError(i18n("Error initializing provider."));
218 }
219 n = n.nextSiblingElement();
220 }
221 emit signalBusy(i18n("Loading data"));
222}
223
224void Engine::atticaProviderLoaded(const Attica::Provider& atticaProvider)
225{
226 if (!atticaProvider.hasContentService()) {
227 kDebug() << "Found provider: " << atticaProvider.baseUrl() << " but it does not support content";
228 return;
229 }
230 QSharedPointer<KNS3::Provider> provider =
231 QSharedPointer<KNS3::Provider> (new AtticaProvider(atticaProvider, m_categories));
232 addProvider(provider);
233}
234
235void Engine::addProvider(QSharedPointer<KNS3::Provider> provider)
236{
237 m_providers.insert(provider->id(), provider);
238 connect(provider.data(), SIGNAL(providerInitialized(KNS3::Provider*)), SLOT(providerInitialized(KNS3::Provider*)));
239 connect(provider.data(), SIGNAL(loadingFinished(KNS3::Provider::SearchRequest,KNS3::EntryInternal::List)),
240 SLOT(slotEntriesLoaded(KNS3::Provider::SearchRequest,KNS3::EntryInternal::List)));
241 connect(provider.data(), SIGNAL(entryDetailsLoaded(KNS3::EntryInternal)), SLOT(slotEntryDetailsLoaded(KNS3::EntryInternal)));
242 connect(provider.data(), SIGNAL(payloadLinkLoaded(KNS3::EntryInternal)), SLOT(downloadLinkLoaded(KNS3::EntryInternal)));
243 connect(provider.data(), SIGNAL(signalError(QString)), this, SIGNAL(signalError(QString)));
244 connect(provider.data(), SIGNAL(signalInformation(QString)), this, SIGNAL(signalIdle(QString)));
245}
246
247void Engine::providerJobStarted ( KJob* job )
248{
249 emit jobStarted(job, i18n("Loading data from provider"));
250}
251
252void Engine::slotProvidersFailed()
253{
254 emit signalError(i18n("Loading of providers from file: %1 failed", m_providerFileUrl));
255}
256
257void Engine::providerInitialized(Provider* p)
258{
259 kDebug() << "providerInitialized" << p->name();
260 p->setCachedEntries(m_cache->registryForProvider(p->id()));
261 updateStatus();
262
263 foreach (const QSharedPointer<KNS3::Provider> &p, m_providers) {
264 if (!p->isInitialized()) {
265 return;
266 }
267 }
268 emit signalProvidersLoaded();
269}
270
271void Engine::slotEntriesLoaded(const KNS3::Provider::SearchRequest& request, KNS3::EntryInternal::List entries)
272{
273 m_currentPage = qMax<int>(request.page, m_currentPage);
274 kDebug() << "loaded page " << request.page << "current page" << m_currentPage;
275
276 if (request.sortMode == Provider::Updates) {
277 emit signalUpdateableEntriesLoaded(entries);
278 } else {
279 m_cache->insertRequest(request, entries);
280 emit signalEntriesLoaded(entries);
281 }
282
283 --m_numDataJobs;
284 updateStatus();
285}
286
287void Engine::reloadEntries()
288{
289 emit signalResetView();
290 m_currentPage = -1;
291 m_currentRequest.page = 0;
292 m_numDataJobs = 0;
293
294 foreach (const QSharedPointer<KNS3::Provider> &p, m_providers) {
295 if (p->isInitialized()) {
296 if (m_currentRequest.sortMode == Provider::Installed) {
297 // when asking for installed entries, never use the cache
298 p->loadEntries(m_currentRequest);
299 } else {
300 // take entries from cache until there are no more
301 EntryInternal::List cache = m_cache->requestFromCache(m_currentRequest);
302 while (!cache.isEmpty()) {
303 kDebug() << "From cache";
304 emit signalEntriesLoaded(cache);
305
306 m_currentPage = m_currentRequest.page;
307 ++m_currentRequest.page;
308 cache = m_cache->requestFromCache(m_currentRequest);
309 }
310
311 // Since the cache has no more pages, reset the request's page
312 if (m_currentPage >= 0)
313 m_currentRequest.page = m_currentPage;
314
315 // if the cache was empty, request data from provider
316 if (m_currentPage == -1) {
317 kDebug() << "From provider";
318 p->loadEntries(m_currentRequest);
319
320 ++m_numDataJobs;
321 updateStatus();
322 }
323 }
324 }
325 }
326}
327
328void Engine::setCategoriesFilter(const QStringList& categories)
329{
330 m_currentRequest.categories = categories;
331 reloadEntries();
332}
333
334void Engine::setSortMode(Provider::SortMode mode)
335{
336 if (m_currentRequest.sortMode != mode) {
337 m_currentRequest.page = -1;
338 }
339 m_currentRequest.sortMode = mode;
340 reloadEntries();
341}
342
343void Engine::setSearchTerm(const QString& searchString)
344{
345 m_searchTimer->stop();
346 m_currentRequest.searchTerm = searchString;
347 EntryInternal::List cache = m_cache->requestFromCache(m_currentRequest);
348 if (!cache.isEmpty()) {
349 reloadEntries();
350 } else {
351 m_searchTimer->start();
352 }
353}
354
355void Engine::slotSearchTimerExpired()
356{
357 reloadEntries();
358}
359
360void Engine::requestMoreData()
361{
362 kDebug() << "Get more data! current page: " << m_currentPage << " requested: " << m_currentRequest.page;
363
364 if (m_currentPage < m_currentRequest.page) {
365 return;
366 }
367
368 m_currentRequest.page++;
369 doRequest();
370}
371
372void Engine::requestData(int page, int pageSize)
373{
374 m_currentRequest.page = page;
375 m_currentRequest.pageSize = pageSize;
376 doRequest();
377}
378
379void Engine::doRequest()
380{
381 foreach (const QSharedPointer<KNS3::Provider> &p, m_providers) {
382 if (p->isInitialized()) {
383 p->loadEntries(m_currentRequest);
384 ++m_numDataJobs;
385 updateStatus();
386 }
387 }
388}
389
390void Engine::install(KNS3::EntryInternal entry, int linkId)
391{
392 if (entry.status() == Entry::Updateable) {
393 entry.setStatus(Entry::Updating);
394 } else {
395 entry.setStatus(Entry::Installing);
396 }
397 emit signalEntryChanged(entry);
398
399 kDebug() << "Install " << entry.name()
400 << " from: " << entry.providerId();
401 QSharedPointer<Provider> p = m_providers.value(entry.providerId());
402 if (p) {
403 p->loadPayloadLink(entry, linkId);
404
405 ++m_numInstallJobs;
406 updateStatus();
407 }
408}
409
410void Engine::slotInstallationFinished()
411{
412 --m_numInstallJobs;
413 updateStatus();
414}
415
416void Engine::slotInstallationFailed(const QString& message)
417{
418 --m_numInstallJobs;
419 emit signalError(message);
420}
421
422void Engine::slotEntryDetailsLoaded(const KNS3::EntryInternal& entry)
423{
424 emit signalEntryDetailsLoaded(entry);
425}
426
427void Engine::downloadLinkLoaded(const KNS3::EntryInternal& entry)
428{
429 m_installation->install(entry);
430}
431
432void Engine::uninstall(KNS3::EntryInternal entry)
433{
434 KNS3::EntryInternal::List list = m_cache->registryForProvider(entry.providerId());
435 //we have to use the cached entry here, not the entry from the provider
436 //since that does not contain the list of installed files
437 KNS3::EntryInternal actualEntryForUninstall;
438 foreach(const KNS3::EntryInternal& eInt, list) {
439 if (eInt.uniqueId() == entry.uniqueId()) {
440 actualEntryForUninstall = eInt;
441 break;
442 }
443 }
444 if (!actualEntryForUninstall.isValid()) {
445 kDebug() << "could not find a cached entry with following id:" << entry.uniqueId() <<
446 " -> using the non-cached version";
447 return;
448 }
449
450 entry.setStatus(Entry::Installing);
451 actualEntryForUninstall.setStatus(Entry::Installing);
452 emit signalEntryChanged(entry);
453
454 kDebug() << "about to uninstall entry " << entry.uniqueId();
455 // FIXME: change the status?
456 m_installation->uninstall(actualEntryForUninstall);
457
458 entry.setStatus(Entry::Deleted); //status for actual entry gets set in m_installation->uninstall()
459 emit signalEntryChanged(entry);
460
461}
462
463void Engine::loadDetails(const KNS3::EntryInternal &entry)
464{
465 QSharedPointer<Provider> p = m_providers.value(entry.providerId());
466 p->loadEntryDetails(entry);
467}
468
469void Engine::loadPreview(const KNS3::EntryInternal& entry, EntryInternal::PreviewType type)
470{
471 kDebug() << "START preview: " << entry.name() << type;
472 ImageLoader* l = new ImageLoader(entry, type, this);
473 connect(l, SIGNAL(signalPreviewLoaded(KNS3::EntryInternal,KNS3::EntryInternal::PreviewType)), this, SLOT(slotPreviewLoaded(KNS3::EntryInternal,KNS3::EntryInternal::PreviewType)));
474 l->start();
475 ++m_numPictureJobs;
476 updateStatus();
477}
478
479void Engine::slotPreviewLoaded(const KNS3::EntryInternal& entry, EntryInternal::PreviewType type)
480{
481 kDebug() << "FINISH preview: " << entry.name() << type;
482 emit signalEntryPreviewLoaded(entry, type);
483 --m_numPictureJobs;
484 updateStatus();
485}
486
487void Engine::contactAuthor(const EntryInternal &entry)
488{
489 if (!entry.author().email().isEmpty()) {
490 // invoke mail with the address of the author
491 KToolInvocation::invokeMailer(entry.author().email(), i18n("Re: %1", entry.name()));
492 } else if (!entry.author().homepage().isEmpty()) {
493 KToolInvocation::invokeBrowser(entry.author().homepage());
494 }
495}
496
497void Engine::slotEntryChanged(const KNS3::EntryInternal& entry)
498{
499 emit signalEntryChanged(entry);
500}
501
502bool Engine::userCanVote(const EntryInternal& entry)
503{
504 QSharedPointer<Provider> p = m_providers.value(entry.providerId());
505 return p->userCanVote();
506}
507
508void Engine::vote(const EntryInternal& entry, uint rating)
509{
510 QSharedPointer<Provider> p = m_providers.value(entry.providerId());
511 p->vote(entry, rating);
512}
513
514bool Engine::userCanBecomeFan(const EntryInternal& entry)
515{
516 QSharedPointer<Provider> p = m_providers.value(entry.providerId());
517 return p->userCanBecomeFan();
518}
519
520void Engine::becomeFan(const EntryInternal& entry)
521{
522 QSharedPointer<Provider> p = m_providers.value(entry.providerId());
523 p->becomeFan(entry);
524}
525
526void Engine::updateStatus()
527{
528 if (m_numDataJobs > 0) {
529 emit signalBusy(i18n("Loading data"));
530 } else if (m_numPictureJobs > 0) {
531 emit signalBusy(i18np("Loading one preview", "Loading %1 previews", m_numPictureJobs));
532 } else if (m_numInstallJobs > 0) {
533 emit signalBusy(i18n("Installing"));
534 } else {
535 emit signalIdle(QString());
536 }
537}
538
539void Engine::checkForUpdates()
540{
541 foreach(QSharedPointer<Provider> p, m_providers) {
542 Provider::SearchRequest request(KNS3::Provider::Updates);
543 p->loadEntries(request);
544 }
545}
546
547#include "engine.moc"
atticaprovider.h
cache.h
KConfigBase::group
KConfigGroup group(const char *group)
KConfigBase::hasGroup
bool hasGroup(const char *group) const
KConfigBase::NoAccess
NoAccess
KConfigGroup
KConfig
KConfig::accessMode
AccessMode accessMode() const
KJob
KNS3::AtticaProvider
KNewStuff Attica Provider class.
Definition: atticaprovider.h:47
KNS3::Author::homepage
QString homepage() const
Retrieve the author's homepage.
Definition: knewstuff3/core/author.cpp:60
KNS3::Author::email
QString email() const
Retrieve the author's email address.
Definition: knewstuff3/core/author.cpp:40
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::Engine::requestData
void requestData(int page, int pageSize)
Definition: knewstuff3/core/engine.cpp:372
KNS3::Engine::checkForUpdates
void checkForUpdates()
Definition: knewstuff3/core/engine.cpp:539
KNS3::Engine::userCanBecomeFan
bool userCanBecomeFan(const EntryInternal &entry)
Definition: knewstuff3/core/engine.cpp:514
KNS3::Engine::signalBusy
void signalBusy(const QString &)
KNS3::Engine::categories
QStringList categories() const
Definition: knewstuff3/core/engine.cpp:156
KNS3::Engine::categoriesFilter
QStringList categoriesFilter() const
Definition: knewstuff3/core/engine.cpp:161
KNS3::Engine::signalProvidersLoaded
void signalProvidersLoaded()
KNS3::Engine::signalEntryDetailsLoaded
void signalEntryDetailsLoaded(const KNS3::EntryInternal &entry)
KNS3::Engine::signalError
void signalError(const QString &)
KNS3::Engine::vote
void vote(const EntryInternal &entry, uint rating)
Definition: knewstuff3/core/engine.cpp:508
KNS3::Engine::setCategoriesFilter
void setCategoriesFilter(const QStringList &categories)
Set the categories that will be included in searches.
Definition: knewstuff3/core/engine.cpp:328
KNS3::Engine::signalIdle
void signalIdle(const QString &)
KNS3::Engine::signalEntryChanged
void signalEntryChanged(const KNS3::EntryInternal &entry)
KNS3::Engine::signalEntryPreviewLoaded
void signalEntryPreviewLoaded(const KNS3::EntryInternal &, KNS3::EntryInternal::PreviewType)
KNS3::Engine::~Engine
~Engine()
Destructor.
Definition: knewstuff3/core/engine.cpp:86
KNS3::Engine::install
void install(KNS3::EntryInternal entry, int linkId=1)
Installs an entry's payload file.
Definition: knewstuff3/core/engine.cpp:390
KNS3::Engine::reloadEntries
void reloadEntries()
Definition: knewstuff3/core/engine.cpp:287
KNS3::Engine::becomeFan
void becomeFan(const EntryInternal &entry)
Definition: knewstuff3/core/engine.cpp:520
KNS3::Engine::Engine
Engine(QObject *parent=0)
Constructor.
Definition: knewstuff3/core/engine.cpp:65
KNS3::Engine::jobStarted
void jobStarted(KJob *, const QString &)
KNS3::Engine::userCanVote
bool userCanVote(const EntryInternal &entry)
Definition: knewstuff3/core/engine.cpp:502
KNS3::Engine::setSearchTerm
void setSearchTerm(const QString &searchString)
Definition: knewstuff3/core/engine.cpp:343
KNS3::Engine::requestMoreData
void requestMoreData()
Definition: knewstuff3/core/engine.cpp:360
KNS3::Engine::signalUpdateableEntriesLoaded
void signalUpdateableEntriesLoaded(const KNS3::EntryInternal::List &entries)
KNS3::Engine::loadDetails
void loadDetails(const KNS3::EntryInternal &entry)
Definition: knewstuff3/core/engine.cpp:463
KNS3::Engine::init
bool init(const QString &configfile)
Initializes the engine.
Definition: knewstuff3/core/engine.cpp:96
KNS3::Engine::uninstall
void uninstall(KNS3::EntryInternal entry)
Uninstalls an entry.
Definition: knewstuff3/core/engine.cpp:432
KNS3::Engine::loadPreview
void loadPreview(const KNS3::EntryInternal &entry, EntryInternal::PreviewType type)
Definition: knewstuff3/core/engine.cpp:469
KNS3::Engine::signalEntriesLoaded
void signalEntriesLoaded(const KNS3::EntryInternal::List &entries)
KNS3::Engine::setSortMode
void setSortMode(Provider::SortMode mode)
Definition: knewstuff3/core/engine.cpp:334
KNS3::Engine::signalResetView
void signalResetView()
KNS3::Engine::contactAuthor
void contactAuthor(const EntryInternal &entry)
Try to contact the author of the entry by email or showing their homepage.
Definition: knewstuff3/core/engine.cpp:487
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:55
KNS3::EntryInternal::name
QString name() const
Retrieve the name of the data object.
Definition: entryinternal.cpp:124
KNS3::EntryInternal::setStatus
void setStatus(Entry::Status status)
Returns the checksum for the entry.
Definition: entryinternal.cpp:372
KNS3::EntryInternal::author
Author author() const
Retrieve the author of the object.
Definition: entryinternal.cpp:174
KNS3::EntryInternal::PreviewType
PreviewType
Definition: entryinternal.h:70
KNS3::EntryInternal::status
Entry::Status status() const
Retrieves the entry's status.
Definition: entryinternal.cpp:367
KNS3::EntryInternal::providerId
QString providerId() const
The id of the provider this entry belongs to.
Definition: entryinternal.cpp:144
KNS3::EntryInternal::uniqueId
QString uniqueId() const
Definition: entryinternal.cpp:134
KNS3::EntryInternal::isValid
bool isValid() const
Definition: entryinternal.cpp:119
KNS3::Entry::Installing
@ Installing
Definition: knewstuff3/entry.h:64
KNS3::Entry::Deleted
@ Deleted
Definition: knewstuff3/entry.h:63
KNS3::Entry::Updateable
@ Updateable
Definition: knewstuff3/entry.h:62
KNS3::Entry::Updating
@ Updating
Definition: knewstuff3/entry.h:65
KNS3::ImageLoader
Convenience class for images with remote sources.
Definition: imageloader.h:52
KNS3::ImageLoader::start
void start()
Definition: imageloader.cpp:39
KNS3::Installation
KNewStuff entry installation.
Definition: knewstuff3/core/installation.h:46
KNS3::Installation::install
void install(KNS3::EntryInternal entry)
Installs an entry's payload file.
Definition: knewstuff3/core/installation.cpp:149
KNS3::Installation::readConfig
bool readConfig(const KConfigGroup &group)
Definition: knewstuff3/core/installation.cpp:57
KNS3::Installation::uninstall
void uninstall(KNS3::EntryInternal entry)
Uninstalls an entry.
Definition: knewstuff3/core/installation.cpp:531
KNS3::Provider
KNewStuff Base Provider class.
Definition: knewstuff3/core/provider.h:47
KNS3::Provider::id
virtual QString id() const =0
A unique Id for this provider (the url in most cases)
KNS3::Provider::setCachedEntries
virtual void setCachedEntries(const KNS3::EntryInternal::List &cachedEntries)=0
KNS3::Provider::SortMode
SortMode
Definition: knewstuff3/core/provider.h:52
KNS3::Provider::Updates
@ Updates
Definition: knewstuff3/core/provider.h:58
KNS3::Provider::Installed
@ Installed
Definition: knewstuff3/core/provider.h:57
KNS3::Provider::name
virtual QString name() const
Retrieves the common name of the provider.
Definition: knewstuff3/core/provider.cpp:48
KNS3::StaticXmlProvider
KNewStuff Base Provider class.
Definition: staticxmlprovider.h:42
KNS3::XmlLoader
KNewStuff xml loader.
Definition: xmlloader.h:52
KNS3::XmlLoader::load
void load(const KUrl &url)
Starts asynchronously loading the xml document from the specified URL.
Definition: xmlloader.cpp:39
KStandardDirs::locate
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
KToolInvocation::invokeMailer
static void invokeMailer(const KUrl &mailtoURL, const QByteArray &startup_id=QByteArray(), bool allowAttachments=false)
KToolInvocation::invokeBrowser
static void invokeBrowser(const QString &url, const QByteArray &startup_id=QByteArray())
KUrl
QList< EntryInternal >
QObject
kDebug
#define kDebug
kWarning
#define kWarning
imageloader.h
job.h
kaboutdata.h
kcodecs.h
kcomponentdata.h
kconfig.h
kconfiggroup.h
kdebug.h
timeout
int timeout
i18n
QString i18n(const char *text)
i18np
QString i18np(const char *sing, const char *plur, const A1 &a1)
kmimetype.h
engine.h
kprocess.h
krandom.h
kshell.h
kstandarddirs.h
ktoolinvocation.h
group
group
KNS3
Definition: atticaprovider.cpp:36
list
QStringList list(const QString &fileClass)
staticxmlprovider.h
KNS3::Provider::SearchRequest
used to keep track of a search
Definition: knewstuff3/core/provider.h:64
KNS3::Provider::SearchRequest::searchTerm
QString searchTerm
Definition: knewstuff3/core/provider.h:66
KNS3::Provider::SearchRequest::page
int page
Definition: knewstuff3/core/provider.h:68
KNS3::Provider::SearchRequest::pageSize
int pageSize
Definition: knewstuff3/core/provider.h:69
KNS3::Provider::SearchRequest::sortMode
SortMode sortMode
Definition: knewstuff3/core/provider.h:65
KNS3::Provider::SearchRequest::categories
QStringList categories
Definition: knewstuff3/core/provider.h:67
xmlloader.h
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