Application Class

(KDUpdater::Application)

The Application class represents an application that can be updated. More...

Header: #include <Application>

Public Functions

Application(ConfigurationInterface *config = 0, QObject *p = 0)
~Application()
void addFilesForDelayedDeletion(const QStringList &files)
void addUpdateSource(const QString &name, const QString &title, const QString &description, const QUrl &url, int priority = -1)
QString applicationDirectory() const
QString applicationName() const
QString applicationVersion() const
QStringList filesForDelayedDeletion() const
PackagesInfo *packagesInfo() const
QString packagesXMLFileName() const
void setApplicationDirectory(const QString &dir)
void setPackagesXMLFileName(const QString &fileName)
void setUpdateSourcesXMLFileName(const QString &fileName)
UpdateSourcesInfo *updateSourcesInfo() const
QString updateSourcesXMLFileName() const

Public Slots

void printError(int errorCode, const QString &error)

Static Public Members

Application *instance()

Detailed Description

The Application class represents an application that can be updated.

A KDUpdater application is an application that interacts with one or more update servers and downloads or installs updates. This class helps in describing an application in terms of:

User can also retrieve some information from this class:

  • Application name
  • Application version

Member Function Documentation

Application::Application(ConfigurationInterface *config = 0, QObject *p = 0)

Constructs an application with the parent p and configuration class config.

Application::~Application()

Destroys the application.

void Application::addFilesForDelayedDeletion(const QStringList &files)

Schedules files for delayed deletion.

void Application::addUpdateSource(const QString &name, const QString &title, const QString &description, const QUrl &url, int priority = -1)

Adds the name, title, description, url, and priority of the update source to this class.

See also KDUpdater::UpdateSourceInfo and KDUpdater::UpdateSourcesInfo.

QString Application::applicationDirectory() const

Returns the path to the application directory.

See also setApplicationDirectory().

QString Application::applicationName() const

Returns the application name. By default, QCoreApplication::applicationName() is returned.

QString Application::applicationVersion() const

Returns the application version.

QStringList Application::filesForDelayedDeletion() const

Returns a list of files that are scheduled for delayed deletion.

[static] Application *Application::instance()

Returns a previously created application instance.

PackagesInfo *Application::packagesInfo() const

Returns the KDUpdater::PackagesInfo object associated with this application.

QString Application::packagesXMLFileName() const

Returns the installation information XML file name.

See also setPackagesXMLFileName().

[slot] void Application::printError(int errorCode, const QString &error)

Prints the error code errorCode and error message specified by error.

void Application::setApplicationDirectory(const QString &dir)

Sets the application directory path directory to dir. The installation information and update sources XML files found in the new application directory will be used.

See also applicationDirectory().

void Application::setPackagesXMLFileName(const QString &fileName)

Sets the file name of the installation information XML file for this application to fileName. By default, this is assumed to be Packages.xml in the application directory.

See also packagesXMLFileName() and KDUpdater::PackagesInfo::setFileName().

void Application::setUpdateSourcesXMLFileName(const QString &fileName)

Sets fileName as the file name of the update sources XML file for this application. By default, this is assumed to be UpdateSources.xml in the application directory.

See also updateSourcesXMLFileName() and KDUpdater::UpdateSourcesInfo::setFileName().

UpdateSourcesInfo *Application::updateSourcesInfo() const

Returns the KDUpdater::UpdateSourcesInfo object associated with this application.

QString Application::updateSourcesXMLFileName() const

Returns the update sources XML file name.

See also setUpdateSourcesXMLFileName().