KNewStuff
KNS::CoreEngine Class Reference
#include <coreengine.h>

Detailed Description
KNewStuff core engine.A core engine keeps track of data which is available locally and remote and offers high-level synchronization calls as well as upload and download primitives using an underlying GHNS protocol.
Definition at line 49 of file coreengine.h.
Member Enumeration Documentation
Engine automation can be activated to let the engine take care by itself of all the method calls needed in a workflow.
For example, the download workflow will require entries to be loaded after the providers, and preview images for all entries afterwards.
Calling the methods for those load operations is necessary when automation is off, but it is redundant (and in fact considered an error) when automation is switched on.
The default automation policy is AutomationOff.
- Enumerator:
-
AutomationOn Turn on automation, and take care of method calls. Turn off automation, and let the application call the methods. (default)
AutomationOff
Definition at line 100 of file coreengine.h.
Policy on how to cache the data received from the network.
While CacheNever completely switches off all caching, the other two settings CacheReplaceable and CacheResident will optimize the network traffic needed for all workflows. CacheOnly will never download from the network at all and can be used to inspect the local cache.
Provider files, feeds, entries and preview images are subject to this policy.
The default cache policy is CacheNever.
- Enumerator:
Definition at line 77 of file coreengine.h.
Constructor & Destructor Documentation
CoreEngine::CoreEngine | ( | QObject * | parent | ) |
CoreEngine::~CoreEngine | ( | ) |
Destructor.
Frees up all the memory again which might be taken by cached entries and providers.
Definition at line 59 of file coreengine.cpp.
Member Function Documentation
void CoreEngine::downloadPayload | ( | Entry * | entry | ) |
Downloads a payload file.
The payload file matching most closely the current user language preferences will be downloaded. The file will not be installed set, for this install must be called.
- Parameters:
-
entry Entry to download payload file for
- See also:
- signalPayloadLoaded
Definition at line 286 of file coreengine.cpp.
void CoreEngine::downloadPreview | ( | Entry * | entry | ) |
Downloads a preview file.
The preview file matching most closely the current user language preferences will be downloaded.
This method should not be called if automation is activated.
- Parameters:
-
entry Entry to download preview image for
- See also:
- signalPreviewLoaded
Definition at line 255 of file coreengine.cpp.
Initializes the engine.
This step is application-specific and relies on an external configuration file, which determines all the details about the initialization.
- Parameters:
-
configfile KNewStuff2 configuration file (*.knsrc)
- Returns:
- true if any valid configuration was found, false otherwise
Definition at line 64 of file coreengine.cpp.
Installs an entry's payload file.
This includes verification, if necessary, as well as decompression and other steps according to the application's *.knsrc file. Note that this method is asynchronous and thus the return value will only report the successful start of the installation.
- Parameters:
-
payloadfile Path to file to install
- Returns:
- Whether or not installation was started successfully
- Note:
- FIXME: use Entry as parameter
Definition at line 1311 of file coreengine.cpp.
void CoreEngine::loadEntries | ( | Provider * | provider | ) |
Loads all entries of all the feeds from a provider.
This means that meta information about those entries is retrieved from the cache and/or from the network, depending on the cache policy.
This method should not be called if automation is activated.
- Parameters:
-
provider Provider from where to load the entries
- See also:
- signalEntryLoaded
Reimplemented in KNS::DxsEngine.
Definition at line 217 of file coreengine.cpp.
void CoreEngine::mergeEntries | ( | Entry::List | entries, | |
Feed * | feed, | |||
const Provider * | provider | |||
) | [protected] |
Definition at line 1014 of file coreengine.cpp.
void CoreEngine::setAutomationPolicy | ( | AutomationPolicy | policy | ) |
Definition at line 1569 of file coreengine.cpp.
void CoreEngine::setCachePolicy | ( | CachePolicy | policy | ) |
Definition at line 1574 of file coreengine.cpp.
void KNS::CoreEngine::signalEntriesFailed | ( | ) | [signal] |
void KNS::CoreEngine::signalEntriesFeedFinished | ( | const KNS::Feed * | feed | ) | [signal] |
void KNS::CoreEngine::signalEntriesFinished | ( | ) | [signal] |
void KNS::CoreEngine::signalEntryChanged | ( | KNS::Entry * | entry | ) | [signal] |
void KNS::CoreEngine::signalEntryFailed | ( | ) | [signal] |
void KNS::CoreEngine::signalEntryLoaded | ( | KNS::Entry * | entry, | |
const KNS::Feed * | feed, | |||
const KNS::Provider * | provider | |||
) | [signal] |
void KNS::CoreEngine::signalEntryRemoved | ( | KNS::Entry * | entry, | |
const KNS::Feed * | feed | |||
) | [signal] |
void KNS::CoreEngine::signalEntryUploaded | ( | ) | [signal] |
void KNS::CoreEngine::signalInstallationFailed | ( | ) | [signal] |
void KNS::CoreEngine::signalInstallationFinished | ( | ) | [signal] |
void KNS::CoreEngine::signalPayloadFailed | ( | KNS::Entry * | entry | ) | [signal] |
void KNS::CoreEngine::signalPayloadLoaded | ( | KUrl | payload | ) | [signal] |
void KNS::CoreEngine::signalPreviewFailed | ( | ) | [signal] |
void KNS::CoreEngine::signalPreviewLoaded | ( | KUrl | preview | ) | [signal] |
void KNS::CoreEngine::signalProgress | ( | const QString & | message, | |
int | percentage | |||
) | [signal] |
void KNS::CoreEngine::signalProviderChanged | ( | KNS::Provider * | provider | ) | [signal] |
void KNS::CoreEngine::signalProviderLoaded | ( | KNS::Provider * | provider | ) | [signal] |
Indicates that the list of providers has been successfully loaded.
This signal might occur twice, for the local cache and for updated provider information from the ProvidersUrl.
void KNS::CoreEngine::signalProvidersFailed | ( | ) | [signal] |
void KNS::CoreEngine::signalProvidersFinished | ( | ) | [signal] |
void CoreEngine::start | ( | ) |
Starts the engine.
This method reports all cached and registered providers to the application. Depending on the cache policy, the engine will then try to synchronize the cache by updating all information about the providers.
If engine automation is activated, this method will proceed to synchronize all feeds, entries and preview images. For each provider, all feeds are considered. The synchronization is complete if signalEntriesFinished is emitted, but applications should continue watching signalEntryChanged.
- See also:
- signalProviderLoaded
Definition at line 181 of file coreengine.cpp.
bool CoreEngine::uninstall | ( | KNS::Entry * | entry | ) |
Uninstalls an entry.
It reverses the steps which were performed during the installation.
- Parameters:
-
entry The entry to deinstall
- Returns:
- Whether or not deinstallation was successful
- Note:
- FIXME: I don't believe this works yet :)
Definition at line 1530 of file coreengine.cpp.
Uploads a complete entry, including its payload and preview files (if present) and all associated meta information.
Note that this method is asynchronous and thus the return value will not report the final success of all upload steps. It will merely check that the provider supports upload and so forth.
- Returns:
- Whether or not upload was started successfully
- See also:
- signalEntryUploaded
Definition at line 324 of file coreengine.cpp.
The documentation for this class was generated from the following files: