Repository Class | Qt Installer Framework Manual

- Qt Installer Framework Manual
- Repository

# Repository Class

(QInstaller::Repository)

- List of all members, including inherited members

## Public Functions

| Repository(const QInstaller::Repository &other)
| Repository(const QUrl &url, bool isDefault, bool compressed = false)
QString | categoryname() const
QString | displayname() const
bool | isCompressed() const
bool | isDefault() const
bool | isEnabled() const
bool | isValid() const
QString | password() const
void | setCategoryName(const QString &categoryname)
void | setDisplayName(const QString &displayname)
void | setEnabled(bool enabled)
void | setPassword(const QString &password)
void | setUrl(const QUrl &url)
void | setUsername(const QString &username)
void | setXmlChecksum(const QByteArray &checksum)
QUrl | url() const
QString | username() const
QByteArray | xmlChecksum() const
bool | operator!=(const QInstaller::Repository &other) const
const QInstaller::Repository & | operator=(const QInstaller::Repository &other)
bool | operator==(const QInstaller::Repository &other) const

## Static Public Members

QInstaller::Repository | fromUserInput(const QString &repositoryUrl, bool compressed = false)

## Member Function Documentation

### Repository::Repository(const QInstaller::Repository &other)

Constructs a new repository by using all fields of the given repository other.

### Repository::Repository(const QUrl &url, bool isDefault, bool compressed = false)

Constructs a new repository by setting its address to url and isDefault and compressed states.

### QString Repository::categoryname() const

Returns the archive name if the repository belongs to an archive.

### QString Repository::displayname() const

Returns the Name for the repository to be displayed instead of the URL.

### `[static]` QInstaller::Repository Repository::fromUserInput(const QString &repositoryUrl, bool compressed = false)

Constructs a new repository by setting its address to repositoryUrl as string and its compressed state.

Note: user and password can be inside the repositoryUrl string: http://user:password@repository.url

### bool Repository::isCompressed() const

Returns true if repository is compressed

### bool Repository::isDefault() const

Returns true if the repository was set using the package manager configuration file; otherwise returns false.

### bool Repository::isEnabled() const

Returns whether the repository is enabled and used during information retrieval.

### bool Repository::isValid() const

Returns true if the repository URL is valid; otherwise returns false.

Note: The URL is simply run through a conformance test. It is not checked that the repository actually exists.

### QString Repository::password() const

Returns the password used for authentication.

See also setPassword().

### void Repository::setCategoryName(const QString &categoryname)

Sets the category name to categoryname if the repository belongs to a category.

### void Repository::setDisplayName(const QString &displayname)

Sets the DisplayName of the repository to displayname.

### void Repository::setEnabled(bool enabled)

Sets this repository to enabled state. If enabled is `true`, the repository is used for information retrieval.

See also isEnabled().

### void Repository::setPassword(const QString &password)

Sets the password for authentication to be password.

See also password().

### void Repository::setUrl(const QUrl &url)

Sets the repository URL to the one specified at url.

See also url().

### void Repository::setUsername(const QString &username)

Sets the user name for authentication to be username.

See also username().

### void Repository::setXmlChecksum(const QByteArray &checksum)

Sets the expected checksum of the repository to `checksum`. The checksum is calculated from the `Updates.xml` document at the root of the repository.

See also xmlChecksum().

### QUrl Repository::url() const

Returns the URL of the repository. By default an invalid QUrl is returned.

See also setUrl().

### QString Repository::username() const

Returns the user name used for authentication.

See also setUsername().

### QByteArray Repository::xmlChecksum() const

Returns the expected checksum of the repository, which is the checksum calculated from the `Updates.xml` document at the root of the repository.

This value is used as a hint when looking for already fetched repositories from the local cache. If the installer has cached a repository with a matching checksum, it can skip downloading the `Updates.xml` file for that repository again.

See also setXmlChecksum().

### bool Repository::operator!=(const QInstaller::Repository &other) const

Returns true if the other repository is not equal to this repository; otherwise returns false. Two repositories are considered equal if they contain the same elements.

See also operator==().

### const QInstaller::Repository &Repository::operator=(const QInstaller::Repository &other)

Assigns the values of repository other to this repository.

### bool Repository::operator==(const QInstaller::Repository &other) const

Compares the values of this repository to other and returns true if they are equal (same server, default state, enabled state as well as username and password).

See also operator!=().