• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KNewStuff

KNS::Engine

KNS::Engine Class Reference

The KNewStuff2 engine is the top-level class to handle GHNS and DXS workflows. More...

#include <engine.h>

List of all members.


Public Member Functions

void downloadDialog ()
KNS::Entry::List downloadDialogModal (QWidget *parent=0)
 Engine (QWidget *parent=0)
bool init (const QString &config)
void uploadDialog (const QString &file)
KNS::Entry * uploadDialogModal (const QString &file)
 ~Engine ()

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.

Definition at line 40 of file engine.h.


Constructor & Destructor Documentation

Engine::Engine ( QWidget *  parent = 0  )  [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 88 of file engine.cpp.

Engine::~Engine (  ) 

Engine destructor.

Deletes an engine and frees all memory occupied by it.

Definition at line 93 of file engine.cpp.


Member Function Documentation

KNS::Entry::List Engine::download (  )  [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 150 of file 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. Affected entries will be reported by signals.

See also:
downloadDialogModal()

Definition at line 188 of file 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 176 of file engine.cpp.

bool Engine::init ( const QString &  config  ) 

Definition at line 220 of file engine.cpp.

KNS::Entry * Engine::upload ( const QString &  file  )  [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 226 of file 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 253 of file 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 240 of file engine.cpp.


The documentation for this class was generated from the following files:
  • engine.h
  • engine.cpp

KNewStuff

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal