KNewStuff
#include <engine.h>
Public Member Functions | |
Engine (QWidget *parent=0) | |
~Engine () | |
void | downloadDialog () |
void | downloadDialog (QObject *receiver, const char *slot) |
KNS::Entry::List | downloadDialogModal (QWidget *parent=0) |
bool | init (const QString &config) |
void | uploadDialog (const QString &file) |
KNS::Entry * | uploadDialogModal (const QString &file) |
Static Public Member Functions | |
static KNS::Entry::List | download () |
static KNS::Entry * | upload (const QString &file) |
Detailed Description
The KNewStuff2 engine is the top-level class to handle GHNS and DXS workflows.
An engine implements GHNS workflows, which consist of discrete steps performed by the inherited engine. Depending on the provider, traditional GHNS or DXS are used transparently. This class is the one which applications should use. In most cases, either upload() or download() will be called by the application to upload or download data.
Deprecated, use knewstuff3!
Definition at line 43 of file knewstuff2/engine.h.
Constructor & Destructor Documentation
|
explicit |
Engine constructor.
As many engines as needed can be instantiated, although one should use the static methods download() and upload() instead.
Definition at line 96 of file knewstuff2/engine.cpp.
Engine::~Engine | ( | ) |
Engine destructor.
Deletes an engine and frees all memory occupied by it.
Definition at line 101 of file knewstuff2/engine.cpp.
Member Function Documentation
|
static |
Recommended download workflow entry point.
This method is a static convenience wrapper around downloadDialogModal() which does not require the manual construction of an engine object. The engine will be configured to load appname.knsrc. The resulting entry list must not be freed, as the engine will continue to keep track of it.
- Returns
- List of installed or deinstalled entries NOTE: this is a copy of each entry because this call deletes its own engine which deletes the original entries, so you need to delete the entries returned in the list
- See also
- downloadDialogModal()
Definition at line 176 of file knewstuff2/engine.cpp.
void Engine::downloadDialog | ( | ) |
Asynchronous way of starting the download workflow.
This method should be used whenever a blocking application with a non-blocking GUI during GHNS operations is not suitable.
- See also
- downloadDialogModal()
Definition at line 224 of file knewstuff2/engine.cpp.
void Engine::downloadDialog | ( | QObject * | receiver, |
const char * | slot | ||
) |
Asynchronous way of starting the download workflow and getting feedback to a slot when the dialog closes.
This method should be used whenever a blocking application with a non-blocking GUI during GHNS operations is not suitable. the slot passed in should have the signature (KNS::Entry::List) as its parameter
- See also
- downloadDialogModal()
Definition at line 247 of file knewstuff2/engine.cpp.
KNS::Entry::List Engine::downloadDialogModal | ( | QWidget * | parent = 0 | ) |
Synchronous way of starting the download workflow.
Starts the download workflow. This workflow will turn up a dialog where the user can select entries for installation and uninstallation. This method is a modal one. It will return all affected entries as a list.
NOTE: this list must be queried to see which ones were installed and which were uninstalled since both are in the one list. i.e. (entry->status() == KNS::Entry::Installed) NOTE: the list returned is not a copy of each entry, so do not delete the entries returned here
- Returns
- List of installed or deinstalled entries
Definition at line 202 of file knewstuff2/engine.cpp.
Definition at line 272 of file knewstuff2/engine.cpp.
|
static |
Recommended upload workflow entry point.
This method is a static convenience wrapper around uploadDialogModal() which does not require the manual construction of an engine object. The engine will be configured to load appname.knsrc. The resulting entry must not be freed, as the engine will continue to keep track of it.
- Returns
- Uploaded entry, or null in case of failures
- See also
- uploadDialogModal()
Definition at line 278 of file knewstuff2/engine.cpp.
void Engine::uploadDialog | ( | const QString & | file | ) |
Asynchronous way of starting the upload workflow.
This method should be used whenever a blocking application with a non-blocking GUI during GHNS operations is not suitable. The affected entry will be reported by signals.
- See also
- uploadDialogModal()
Definition at line 305 of file knewstuff2/engine.cpp.
KNS::Entry * Engine::uploadDialogModal | ( | const QString & | file | ) |
Synchronous way of starting the upload workflow.
Starts the upload workflow. This workflow will offer provider selection and afterwards upload all files associated with an entry. This method is a modal one. It will return the uploaded entry.
- Returns
- Uploaded entry, or null in case of failures
Definition at line 292 of file knewstuff2/engine.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:49 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.