diff options
author | kh1 <qt-info@nokia.com> | 2011-03-21 13:29:21 +0100 |
---|---|---|
committer | kh1 <qt-info@nokia.com> | 2011-03-21 13:29:21 +0100 |
commit | 2888efbd67692c69b91965233d3ed424ad2302ae (patch) | |
tree | 8c097aca837ea67dc4365d0d213d9632041f2675 /installerbuilder | |
parent | adcd83be6004c67e9d963114860851b38d309fcd (diff) |
Small cleanup and added documentation.
Diffstat (limited to 'installerbuilder')
-rw-r--r-- | installerbuilder/common/repository.cpp | 59 | ||||
-rw-r--r-- | installerbuilder/common/repository.h | 49 |
2 files changed, 73 insertions, 35 deletions
diff --git a/installerbuilder/common/repository.cpp b/installerbuilder/common/repository.cpp index ecd4d8a98..38c4ed646 100644 --- a/installerbuilder/common/repository.cpp +++ b/installerbuilder/common/repository.cpp @@ -32,27 +32,68 @@ **************************************************************************/ #include "repository.h" -using namespace QInstaller; +namespace QInstaller { -Repository::Repository() : m_required( false ) { +/* + Constructs an invalid Repository object. +*/ +Repository::Repository() + : m_required(false) +{ } -void Repository::setUrl( const QUrl& url ) { - m_url = url; +/*! + Constructs a new repository by setting it's address to \a url. +*/ +Repository::Repository(const QUrl &url) + : m_url(url) + , m_required(false) +{ } -bool Repository::isValid() const { +/*! + Returns true if the repository URL is valid; otherwise returns false. + + Note: The URL is simpley run through a conformance test. It is not checked that the repository + actually exists. +*/ +bool Repository::isValid() const +{ return m_url.isValid(); } -QUrl Repository::url() const { +/*! + Returns the URL of the repository. By default an invalid \sa QUrl is returned. +*/ +QUrl Repository::url() const +{ return m_url; } -void Repository::setRequired( bool r ) { - m_required = r; +/*! + Sets the repository URL to the one specified at \a url. +*/ +void Repository::setUrl(const QUrl& url) +{ + m_url = url; } -bool Repository::required() const { +/*! + Returns whether the repository is required for installation. If a required repository cannot be + reached or an error occurrs accessing it, the installer will fail. +*/ +bool Repository::required() const +{ return m_required; } + +/*! + Sets whether the repository is required for installation. If a required repository cannot be + reached or an error occurrs accessing it, the installer will fail. +*/ +void Repository::setRequired(bool required) +{ + m_required = required; +} + +} diff --git a/installerbuilder/common/repository.h b/installerbuilder/common/repository.h index e6680b9f0..badaed5c9 100644 --- a/installerbuilder/common/repository.h +++ b/installerbuilder/common/repository.h @@ -26,34 +26,31 @@ #ifndef REPOSITORY_H #define REPOSITORY_H -#include <QUrl> - #include "installer_global.h" +#include <QtCore/QUrl> + namespace QInstaller { - class INSTALLER_EXPORT Repository - { - public: - Repository(); - - void setUrl( const QUrl& url ); - QUrl url() const; - - bool isValid() const; - - void setRequired( bool r ); - - /** - * returns whether the repository is required for installation. If a - * required repository cannot be reached or an error occurrs accessing - * it, the installer will fail. - */ - bool required() const; - - private: - bool m_required; - QUrl m_url; - }; -} + +class INSTALLER_EXPORT Repository +{ +public: + Repository(); + explicit Repository(const QUrl &url); + + bool isValid() const; + + QUrl url() const; + void setUrl(const QUrl& url); + + bool required() const; + void setRequired(bool required); + +private: + QUrl m_url; + bool m_required; +}; + +} // namespace QInstaller #endif // REPOSITORY_H |