KCompositeJob

KDE 4.9 PyKDE API Reference

- KDE's Python API

# KCompositeJob Class Reference

`from PyKDE4.kdecore import *`

Inherits: KJob → QObject

## Detailed Description

The base class for all jobs able to be composed of one or more subjobs.

## Methods
| __init__ (self, QObject parent=0)
bool | addSubjob (self, KJob job)
| clearSubjobs (self)
bool | hasSubjobs (self)
bool | removeSubjob (self, KJob job)
| slotInfoMessage (self, KJob job, QString plain, QString rich)
| slotResult (self, KJob job)
[KJob] | subjobs (self)

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

Creates a new KCompositeJob object.

Parameters:

  | parent | the parent QObject

bool addSubjob | ( | self, |
|  | KJob | job
| ) |  |  |

Add a job that has to be finished before a result is emitted. This has obviously to be called before the result has been emitted by the job.

Parameters:

  | job | the subjob to add

Returns:
  true if the job has been added correctly, false otherwise

clearSubjobs | ( |  | self ) |

Clears the list of subjobs.

bool hasSubjobs | ( |  | self ) |

Checks if this job has subjobs running.

Returns:
  true if we still have subjobs running, false otherwise

bool removeSubjob | ( | self, |
|  | KJob | job
| ) |  |  |

Mark a sub job as being done.

Parameters:

  | job | the subjob to remove

Returns:
  true if the job has been removed correctly, false otherwise

slotInfoMessage | ( | self, |
|  | KJob | job,
|  | QString | plain,
|  | QString | rich
| ) |  |  |

Forward signal from subjob.

Parameters:

  | job | the subjob
  | plain | the info message in plain text version
  | rich | the info message in rich text version

See also:
  infoMessage()

slotResult | ( | self, |
|  | KJob | job
| ) |  |  |

Called whenever a subjob finishes. Default implementation checks for errors and propagates to parent job, and in all cases it calls removeSubjob.

Parameters:

  | job | the subjob

[KJob] subjobs | ( |  | self ) |

Retrieves the list of the subjobs.

Returns:
  the full list of sub jobs