diff options
author | Katja Marttila <katja.marttila@qt.io> | 2019-12-02 13:31:27 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2019-12-17 06:43:31 +0000 |
commit | eca45594967aba89c124a8b88ee8917b35d76181 (patch) | |
tree | 4396223e2ae389c986188cf4942ee07a606fb877 /src/libs/installer/component.cpp | |
parent | 4744ad130a2d4310e812a89da22d36a2e885b281 (diff) |
Documentation fixes
Change-Id: Ibffb5470d374c8d612791f48c951deddd00f3121
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r-- | src/libs/installer/component.cpp | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index cd40d4a7b..e8abe2383 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -70,6 +70,21 @@ static const QLatin1String scExpandedByDefault("ExpandedByDefault"); static const QLatin1String scUnstable("Unstable"); /*! + \enum Component::UnstableError + + This enum type holds the component unstable error reason: + + \value DepencyToUnstable + Component has a dependency to an unstable component. + \value ShaMismatch + Component has packages with non-matching SHA values. + \value ScriptLoadingFailed + Component script has errors or loading fails. + \value MissingDependency + Component has dependencies to missing components. +*/ + +/*! \inmodule QtInstallerFramework \class Component::SortingPriorityLessThan \brief The SortingPriorityLessThan class sets an increasing sorting order for child components. @@ -185,6 +200,14 @@ static const QLatin1String scUnstable("Unstable"); */ /*! + \property Component::unstable + + \brief Whether the component is unstable. This is a read-only property. + + \note Unstable components cannot be selected for installation. +*/ + +/*! \fn Component::loaded() \sa {component::loaded}{component.loaded} @@ -524,12 +547,12 @@ void Component::loadComponentScript(const QString &fileName) Component *dependencyComponent = packageManagerCore()->componentByName (PackageManagerCore::checkableName(dependency)); if (dependencyComponent && dependencyComponent->isUnstable()) - setUnstable(PackageManagerCore::UnstableError::DepencyToUnstable, QLatin1String("Dependent on unstable component")); + setUnstable(Component::UnstableError::DepencyToUnstable, QLatin1String("Dependent on unstable component")); } } } catch (const Error &error) { if (packageManagerCore()->settings().allowUnstableComponents()) { - setUnstable(PackageManagerCore::UnstableError::ScriptLoadingFailed, error.message()); + setUnstable(Component::Component::ScriptLoadingFailed, error.message()); qWarning() << error.message(); } else { throw error; @@ -1090,6 +1113,8 @@ bool Component::addOperation(QQmlV4Function *func) The variables that the parameters contain, such as \c @TargetDir@, are replaced with their values. + Returns \c true if the operation is created; otherwise returns \c false. + \sa {component::addOperation}{component.addOperation} */ bool Component::addOperation(const QString &operation, const QStringList ¶meters) @@ -1118,6 +1143,8 @@ bool Component::addElevatedOperation(QQmlV4Function *func) The variables that the parameters contain, such as \c @TargetDir@, are replaced with their values. The operation is executed with elevated rights. + Returns \c true if the operation is created; otherwise returns \c false. + \sa {component::addElevatedOperation}{component.addElevatedOperation} */ bool Component::addElevatedOperation(const QString &operation, const QStringList ¶meters) @@ -1135,6 +1162,8 @@ bool Component::addElevatedOperation(const QString &operation, const QStringList would be done by calling createOperations(). If you set this to \c false, it is completely up to the component's script to create all operations. + Returns \c false when component's script will create all operations; otherwise returns \c true. + \sa {component::autoCreateOperations}{component.autoCreateOperations} */ bool Component::autoCreateOperations() const @@ -1215,7 +1244,7 @@ QStringList Component::dependencies() const Adds the component specified by \a newDependOn to the automatic depend-on list. \sa {component::addAutoDependOn}{component.addAutoDependOn} - \sa dependencies + \sa autoDependencies */ void Component::addAutoDependOn(const QString &newDependOn) @@ -1387,12 +1416,20 @@ bool Component::isUninstalled() const return scUninstalled == d->m_vars.value(scCurrentState); } +/*! + Returns \c true if this component is unstable. +*/ + bool Component::isUnstable() const { return scTrue == d->m_vars.value(scUnstable); } -void Component::setUnstable(PackageManagerCore::UnstableError error, const QString &errorMessage) +/*! + Sets this component, all its child components and all the components depending on + this component unstable with the error code \a error and message \a errorMessage. +*/ +void Component::setUnstable(Component::UnstableError error, const QString &errorMessage) { QList<Component*> dependencies = d->m_core->dependees(this); // Mark this component unstable @@ -1410,7 +1447,7 @@ void Component::setUnstable(PackageManagerCore::UnstableError error, const QStri foreach (Component *descendant, this->descendantComponents()) { descendant->markComponentUnstable(); } - QMetaEnum metaEnum = QMetaEnum::fromType<PackageManagerCore::UnstableError>(); + QMetaEnum metaEnum = QMetaEnum::fromType<Component::UnstableError>(); emit packageManagerCore()->unstableComponentFound(QLatin1String(metaEnum.valueToKey(error)), errorMessage, this->name()); } |