# knewstuff Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KNewStuffGeneric Class Reference

Basic KNewStuff class with predefined actions. More...

`#include <knewstuffgeneric.h>`

Inheritance diagram for KNewStuffGeneric:

[legend]
Collaboration diagram for KNewStuffGeneric:

[legend]
List of all members.

## Public Member Functions

| KNewStuffGeneric (const QString &type, QWidget *parent=0)
bool | install (const QString &fileName)
bool | createUploadFile (const QString &fileName)
QString | downloadDestination (KNS::Entry *entry)

## Detailed Description

Basic KNewStuff class with predefined actions.

This class is used for data uploads and installation.

     QString payload, preview;
     KNewStuffGeneric *ns = new KNewStuffGeneric("kamikaze/level", this);
     ns->upload(payload, preview);

Author:
  Cornelius Schumacher (schumacher@kde.org)

Maintainer:
  Josef Spillner (spillner@kde.org)

Definition at line 42 of file knewstuffgeneric.h.

## Constructor & Destructor Documentation

KNewStuffGeneric::KNewStuffGeneric | ( | const QString & | type,
|  | QWidget * | parent = `0`
| ) |

Constructor.

Parameters:

  | type | a Hotstuff data type such as "korganizer/calendar"
  | parent | the parent window.

Definition at line 40 of file knewstuffgeneric.cpp.

## Member Function Documentation

bool KNewStuffGeneric::install | ( | const QString & | fileName | ) | `[virtual]`

Installs a downloaded file according to the application's configuration.

Parameters:

  | fileName | filename of the donwloaded file

Returns:
  `true` in case of installation success, `false` otherwise

Implements KNewStuff.

Definition at line 50 of file knewstuffgeneric.cpp.

References QString::isEmpty(), QFile::remove(), and QStringList::split().

bool KNewStuffGeneric::createUploadFile | ( | const QString & | fileName | ) | `[virtual]`

Creates a file suitable for upload.

Note that this method always fails, since using KNewStuffGeneric means that the provided file must already be in a usable format.

Parameters:

  | fileName | the name of the file to upload after its creation

Returns:
  `true` in case of creation success, `false` otherwise

Implements KNewStuff.

Definition at line 83 of file knewstuffgeneric.cpp.

QString KNewStuffGeneric::downloadDestination | ( | KNS::Entry * | entry | ) | `[virtual]`

Queries the preferred destination file for a download.

Parameters:

  | entry | a Hotstuff data entry

Returns:
  destination filename, or 0 to return directory only

Reimplemented from KNewStuff.

Definition at line 127 of file knewstuffgeneric.cpp.

References KNewStuff::parentWidget().

The documentation for this class was generated from the following files:

- knewstuffgeneric.h
- knewstuffgeneric.cpp

This file is part of the documentation for knewstuff Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:28:36 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003