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

Plasma

  • Plasma
  • ServiceJob
Public Member Functions | Protected Member Functions | Properties | List of all members
Plasma::ServiceJob Class Reference

#include <Plasma/ServiceJob>

Inheritance diagram for Plasma::ServiceJob:
Inheritance graph
[legend]

Public Member Functions

 ServiceJob (const QString &destination, const QString &operation, const QMap< QString, QVariant > &parameters, QObject *parent=0)
 
 ~ServiceJob ()
 
QString destination () const
 
Credentials identity () const
 
QString operationName () const
 
QMap< QString, QVariant > parameters () const
 
QVariant result () const
 
virtual Q_INVOKABLE void start ()
 

Protected Member Functions

void setResult (const QVariant &result)
 

Properties

QString destination
 
QString operationName
 
QVariant result
 

Detailed Description

This class provides jobs for use with Plasma::Service.

Unlike KJob, you can do the work in start(), since Plasma::Service already delays the call to start() until the event loop is reached.

If the job is quick enough that it is not worth reporting the progress, you just need to implement start() to do the task, then call emitResult() at the end of it. If the task does not complete successfully, you should set a non-zero error code with setError(int) and an error message with setErrorText(QString).

If the job is longer (involving network access, for instance), you should report the progress at regular intervals. See the KJob documentation for information on how to do this.

Definition at line 54 of file servicejob.h.

Constructor & Destructor Documentation

Plasma::ServiceJob::ServiceJob ( const QString &  destination,
const QString &  operation,
const QMap< QString, QVariant > &  parameters,
QObject *  parent = 0 
)

Default constructor.

Parameters
destinationthe subject that the job is acting on
operationthe action that the job is performing on the destination
parametersthe parameters of the action
parentthe parent object for this service

Definition at line 51 of file servicejob.cpp.

Plasma::ServiceJob::~ServiceJob ( )

Destructor.

Definition at line 59 of file servicejob.cpp.

Member Function Documentation

QString Plasma::ServiceJob::destination ( ) const
Returns
the subject that the job is acting on
Credentials Plasma::ServiceJob::identity ( ) const
Returns
the identity of the caller of this operation

Definition at line 79 of file servicejob.cpp.

QString Plasma::ServiceJob::operationName ( ) const
Returns
the operation the job is performing on the destination
QMap< QString, QVariant > Plasma::ServiceJob::parameters ( ) const
Returns
the parameters for the operation

Definition at line 74 of file servicejob.cpp.

QVariant Plasma::ServiceJob::result ( ) const

Returns the result of the operation.

The result will be invalid if the job has not completed yet, or if the job does not have a meaningful result.

Note that this should not be used to find out whether the operation was successful. Instead, you should check the value of error().

Returns
the result of the operation
void Plasma::ServiceJob::setResult ( const QVariant &  result)
protected

Sets the result for an operation.

Definition at line 89 of file servicejob.cpp.

void Plasma::ServiceJob::start ( )
virtual

Default implementation of start, which simply sets the results to false.

This makes it easy to create a "failure" job.

Definition at line 95 of file servicejob.cpp.

Property Documentation

QString Plasma::ServiceJob::destination
read

Definition at line 57 of file servicejob.h.

QString Plasma::ServiceJob::operationName
read

Definition at line 58 of file servicejob.h.

QVariant Plasma::ServiceJob::result
read

Definition at line 59 of file servicejob.h.


The documentation for this class was generated from the following files:
  • servicejob.h
  • servicejob.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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