KDE 4.9 PyKDE API Reference

- KDE's Python API

# DownloadManager Class Reference

`from PyKDE4.knewstuff import *`

Inherits: QObject
Namespace: KNS3

## Detailed Description

KNewStuff update checker. This class can be used to search for KNewStuff items without using the widgets and to look for updates of already installed items without showing the dialog.

Since:
  4.5

## Enumerations
SortOrder | { Newest, Alphabetical, Rating, Downloads }
## Signals
| entryStatusChanged (KNS3.Entry entry)
| searchResult ([KNS3.Entry] entries)
## Methods
| __init__ (self, QObject parent=0)
| __init__ (self, QString configFile, QObject parent=0)
| checkForUpdates (self)
| installEntry (self, KNS3.Entry entry)
| search (self, int page=0, int pageSize=100)
| setSearchOrder (self, KNS3.DownloadManager.SortOrder order)
| setSearchTerm (self, QString searchTerm)
| uninstallEntry (self, KNS3.Entry entry)

## Signal Documentation

entryStatusChanged | ( | KNS3.Entry | entry
| ) |  |  |

The entry status has changed: emitted when the entry has been installed, updated or removed. Use KNS3.Entry.status() to check the current status.

Parameters:

  | entry | the item that has been updated.

Signal syntax:
  `QObject.connect(source, SIGNAL("entryStatusChanged(const KNS3::Entry&)"), target_slot)`

searchResult | ( | [KNS3.Entry] | entries
| ) |  |  |

Returns the search result. This can be the list of updates after checkForUpdates or the result of a search.

Parameters:

  | entries | the list of results. entries is empty when nothing was found.

Signal syntax:
  `QObject.connect(source, SIGNAL("searchResult(const KNS3::Entry::List&)"), target_slot)`

## Method Documentation

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

Create a DownloadManager It will try to find a appname.knsrc file (using KComponentData). Appname is the name of your application as provided in the about data->

Parameters:

  | parent | the parent of the dialog

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

Create a DownloadManager. Manually specifying the name of the .knsrc file.

Parameters:

  | configFile | the name of the configuration file
  | parent |

checkForUpdates | ( |  | self ) |

Check for available updates. Use searchResult to get notified as soon as an update has been found.

installEntry | ( | self, |
|  | KNS3.Entry | entry
| ) |  |  |

Installs or updates an entry

Parameters:

  | entry |

search | ( | self, |
|  | int | page=0,
|  | int | pageSize=100
| ) |  |  |

Search for a list of entries. searchResult will be emitted with the requested list.

setSearchOrder | ( | self, |
|  | KNS3.DownloadManager.SortOrder | order
| ) |  |  |

Set the sort order of the results. This depends on the server. Note that this function does not trigger a search. Use search after setting this.

See also:
  SortOrder

Parameters:

  | order |

setSearchTerm | ( | self, |
|  | QString | searchTerm
| ) |  |  |

Sets the search term to filter the results on the server. Note that this function does not trigger a search. Use search after setting this.

Parameters:

  | searchTerm |

uninstallEntry | ( | self, |
|  | KNS3.Entry | entry
| ) |  |  |

Uninstalls the given entry.

Parameters:

  | entry | The entry which will be uninstalled.

Since:
  4.7

## Enumeration Documentation

SortOrder

Enumerator:

  Newest |
  Alphabetical |
  Rating |
  Downloads |