summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/scripting-api/component.qdoc51
-rw-r--r--src/libs/installer/component.cpp92
2 files changed, 88 insertions, 55 deletions
diff --git a/doc/scripting-api/component.qdoc b/doc/scripting-api/component.qdoc
index 110831cd3..e60223103 100644
--- a/doc/scripting-api/component.qdoc
+++ b/doc/scripting-api/component.qdoc
@@ -159,13 +159,14 @@
/*!
\qmlsignal component::selectedChanged(boolean isSelected)
- Emitted when the component selection has changed to \a isSelected.
+ Emitted when the component selection changes to \a isSelected.
*/
/*!
\qmlsignal component::valueChanged(string key, string value)
- Emitted when the variable with name \a key has changed to \a value.
+ Emitted when the value of the variable with the name \a key changes to
+ \a value.
\sa setValue
*/
@@ -180,8 +181,9 @@
\qmlmethod string component::value(string key, string value = "")
Returns the value of variable name \a key. If \a key is not known yet, \a defaultValue is returned.
- Note: If a component is virtual and you ask for the component value with key "Default", it will always
- return \c false.
+
+ \note If a component is virtual and you ask for the component value with the
+ key "Default", it will always return \c false.
*/
/*!
@@ -199,7 +201,8 @@
/*!
\qmlmethod QWidget component::userInterface(string name)
- Returns the QWidget created for \a name or 0 if the widget already has been deleted or cannot be found.
+ Returns the QWidget created for \a name or \c 0 if the widget has been
+ deleted or cannot be found.
*/
/*!
@@ -207,11 +210,12 @@
Creates all operations needed to install this component's \a path. \a path is a full qualified
filename including the component's name. This method gets called from
- component::createOperationsForArchive. You can override it by providing a method with
+ createOperationsForArchive. You can override it by providing a method with
the same name in the component script.
\note RSA signature files are omitted by this method.
- \note If you call this method from a script, it won't call the scripts method with the same name.
+ \note If you call this method from a script, it will not call the script's
+ method with the same name.
The default implementation is recursively creating Copy and Mkdir operations for all files
and folders within \a path.
@@ -221,10 +225,11 @@
\qmlmethod void component::createOperationsForArchive(string archive)
Creates all operations needed to install this component's \a archive. This method gets called
- from component::createOperations. You can override this method by providing a method with the
+ from createOperations. You can override this method by providing a method with the
same name in the component script.
- \note If you call this method from a script, it won't call the scripts method with the same name.
+ \note If you call this method from a script, it will not call the script's
+ method with the same name.
The default implementation calls createOperationsForPath for everything contained in the archive.
If \a archive is a compressed archive known to the installer system, an Extract operation is
@@ -253,7 +258,8 @@
Creates all operations needed to install this component.
You can override this method by providing a method with the same name in the component script.
- \note If you call this method from a script, it won't call the scripts method with the same name.
+ \note If you call this method from a script, it will not call the script's
+ method with the same name.
The default implementation calls createOperationsForArchive for all archives in this component.
*/
@@ -288,8 +294,8 @@
/*!
\qmlmethod void component::addStopProcessForUpdateRequest(string process)
- Adds a request for quitting the process \a process before installing/updating/uninstalling the
- component.
+ Adds a request for quitting the process \a process before installing,
+ updating, or uninstalling the component.
*/
/*!
@@ -301,7 +307,9 @@
/*!
\qmlmethod void component::setStopProcessForUpdateRequest(string process, boolean requested)
- Convenience: Add/remove request depending on \a requested (add if \c true, remove if \c false).
+ A convenience method for adding or removing the request for stopping
+ \a process depending on whether \a requested is \c true (add) or \c false
+ (remove).
*/
/*!
@@ -355,7 +363,7 @@
/*!
\qmlmethod boolean component::isAutoDependOn(QSet<string> componentsToInstall)
- Determines if the component comes as an auto dependency. Returns \c true if the component needs
+ Determines whether the component comes as an auto dependency. Returns \c true if the component needs
to be installed.
*/
@@ -372,31 +380,32 @@
/*!
\qmlmethod boolean component::isInstalled()
- Determines if the component is installed.
+ Determines whether the component is installed.
*/
/*!
\qmlmethod boolean component::installationRequested()
- Determines if the user wants to install the component
+ Determines whether the user wants to install the component.
*/
/*!
\qmlmethod void component::setUpdateAvailable(boolean isUpdateAvailable)
- Sets a flag that the core found an update
+ Sets a flag that the core found an update.
*/
/*!
\qmlmethod boolean component::updateRequested()
- Determines if the user wants to install the update for this component
+ Determines whether the user wants to install the update for this component.
*/
/*!
\qmlmethod boolean component::componentChangeRequested()
- Returns \c true if that component will be changed (update/installation/uninstallation).
+ Returns \c true if this component will be changed (update, installation, or
+ uninstallation).
*/
/*!
@@ -408,13 +417,13 @@
/*!
\qmlmethod boolean component::isUninstalled()
- Determines if the component is uninstalled.
+ Determines whether the component is uninstalled.
*/
/*!
\qmlmethod boolean component::uninstallationRequested()
- Determines if the user wants to uninstall the component.
+ Determines whether the user wants to uninstall the component.
*/
/*!
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index e2a9cf2e1..957aced03 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -134,7 +134,7 @@ static const QLatin1String scForcedInstallation("ForcedInstallation");
The URLs are prefixed with \c {installer://}.
- \sa addDownloadableArchive, removeDownloadableArchive
+ \sa addDownloadableArchive(), removeDownloadableArchive()
*/
/*!
@@ -186,13 +186,15 @@ static const QLatin1String scForcedInstallation("ForcedInstallation");
/*!
\fn Component::loaded()
- Emitted when the component has been loaded.
+ \sa {component::loaded}{component.loaded}
*/
/*!
\fn Component::selectedChanged(bool selected)
Emitted when the component selection changes to \a selected.
+
+ \sa {component::selectedChanged}{component.selectedChanged}
*/
/*!
@@ -200,13 +202,13 @@ static const QLatin1String scForcedInstallation("ForcedInstallation");
Emitted when the value of the variable with the name \a key changes to \a value.
- \sa setValue
+ \sa {component::valueChanged}{component.valueChanged}, setValue()
*/
/*!
\fn Component::virtualStateChanged()
- Emitted when the virtual state of the component changes.
+ \sa {component::virtualStateChanged}{component.virtualStateChanged}
*/
@@ -385,7 +387,9 @@ QString Component::value(const QString &key, const QString &defaultValue) const
}
/*!
- Sets the value of the variable \a key to \a value.
+ Sets the value of the variable with \a key to \a value.
+
+ \sa {component::setValue}{component.setValue}
*/
void Component::setValue(const QString &key, const QString &value)
{
@@ -654,6 +658,8 @@ QHash<QString, QPair<QString, QString> > Component::licenses() const
/*!
Returns the QWidget created for \a name or \c 0 if the widget has been deleted or cannot
be found.
+
+ \sa {component::userInterface}{component.userInterface}
*/
QWidget *Component::userInterface(const QString &name) const
{
@@ -663,7 +669,7 @@ QWidget *Component::userInterface(const QString &name) const
/*!
Creates all operations needed to install this component's \a path. \a path is a fully qualified
filename including the component's name. This method gets called from
- Component::createOperationsForArchive. You can override it by providing a method with
+ createOperationsForArchive. You can override it by providing a method with
the same name in the component script.
\note RSA signature files are omitted by this method.
@@ -672,6 +678,8 @@ QWidget *Component::userInterface(const QString &name) const
The default implementation is recursively creating Copy and Mkdir operations for all files
and folders within \a path.
+
+ \sa {component::createOperationsForPath}{component.createOperationsForPath}
*/
void Component::createOperationsForPath(const QString &path)
{
@@ -716,6 +724,8 @@ void Component::createOperationsForPath(const QString &path)
The default implementation calls createOperationsForPath for everything contained in the archive.
If \a archive is a compressed archive known to the installer system, an Extract operation is
created, instead.
+
+ \sa {component::createOperationsForArchive}{component.createOperationsForArchive}
*/
void Component::createOperationsForArchive(const QString &archive)
{
@@ -742,18 +752,7 @@ void Component::createOperationsForArchive(const QString &archive)
}
/*!
- Starts the component installation.
- You can override this method by providing a method with the same name in the component script.
-
- \code
- Component.prototype.beginInstallation = function()
- {
- // call default implementation
- component.beginInstallation();
- // ...
- }
- \endcode
-
+ \sa {component::beginInstallation}{component.beginInstallation}
*/
void Component::beginInstallation()
{
@@ -762,14 +761,8 @@ void Component::beginInstallation()
}
/*!
- Creates all operations needed to install this component.
- You can override this method by providing a method with the same name in the component script.
-
- \note If you call this method from a script, it will not call the script's method with the same
- name.
-
- The default implementation calls createOperationsForArchive() for all archives in this
- component.
+ \sa {component::createOperations}{component.createOperations}
+ \sa createOperationsForArchive()
*/
void Component::createOperations()
{
@@ -790,6 +783,8 @@ void Component::createOperations()
Registers the file or directory at \a path for being removed when this component gets uninstalled.
In case of a directory, this will be recursive. If \a wipe is set to \c true, the directory will
also be deleted if it contains changes made by the user after installation.
+
+ \sa {component::registerPathForUninstallation}{component.registerPathForUninstallation}
*/
void Component::registerPathForUninstallation(const QString &path, bool wipe)
{
@@ -823,7 +818,8 @@ QStringList Component::archives() const
downloaded from an online repository. When adding \a path, it will be downloaded from the
repository when the installation starts.
- \sa removeDownloadableArchive, fromOnlineRepository, archives
+ \sa {component::addDownloadableArchive}{component.addDownloadableArchive}
+ \sa removeDownloadableArchive(), fromOnlineRepository, archives
*/
void Component::addDownloadableArchive(const QString &path)
{
@@ -837,7 +833,8 @@ void Component::addDownloadableArchive(const QString &path)
Removes the archive \a path previously added via addDownloadableArchive() from this component.
This can only be called if this component was downloaded from an online repository.
- \sa addDownloadableArchive, fromOnlineRepository, archives
+ \sa {component::removeDownloadableArchive}{component.removeDownloadableArchive}
+ \sa addDownloadableArchive(), fromOnlineRepository, archives
*/
void Component::removeDownloadableArchive(const QString &path)
{
@@ -856,6 +853,8 @@ QStringList Component::downloadableArchives() const
/*!
Adds a request for quitting the process \a process before installing, updating, or uninstalling
the component.
+
+ \sa {component::addStopProcessForUpdateRequest}{component.addStopProcessForUpdateRequest}
*/
void Component::addStopProcessForUpdateRequest(const QString &process)
{
@@ -864,6 +863,8 @@ void Component::addStopProcessForUpdateRequest(const QString &process)
/*!
Removes the request for quitting the process \a process again.
+
+ \sa {component::removeStopProcessForUpdateRequest}{component.removeStopProcessForUpdateRequest}
*/
void Component::removeStopProcessForUpdateRequest(const QString &process)
{
@@ -873,6 +874,8 @@ void Component::removeStopProcessForUpdateRequest(const QString &process)
/*!
A convenience function for adding or removing the request for stopping \a process depending on
whether \a requested is \c true (add) or \c false (remove).
+
+ \sa {component::setStopProcessForUpdateRequest}{component.addStopProcessForUpdateReques}
*/
void Component::setStopProcessForUpdateRequest(const QString &process, bool requested)
{
@@ -1008,6 +1011,8 @@ Operation *Component::createOperation(const QString &operationName, const QStrin
Convenience method for calling the operation \a operation with up to ten parameters:
\a parameter1, \a parameter2, \a parameter3, \a parameter4, \a parameter5, \a parameter6,
\a parameter7, \a parameter8, \a parameter9, and \a parameter10.
+
+ \sa {component::addOperation}{component.addOperation}
*/
bool Component::addOperation(const QString &operation, const QString &parameter1, const QString &parameter2,
const QString &parameter3, const QString &parameter4, const QString &parameter5, const QString &parameter6,
@@ -1041,6 +1046,8 @@ bool Component::addOperation(const QString &operation, const QStringList &parame
Convenience method for calling the elevated operation \a operation with up to ten parameters:
\a parameter1, \a parameter2, \a parameter3, \a parameter4, \a parameter5, \a parameter6,
\a parameter7, \a parameter8, \a parameter9, and \a parameter10.
+
+ \sa {component::addElevatedOperation}{component.addElevatedOperation}
*/
bool Component::addElevatedOperation(const QString &operation, const QString &parameter1,
const QString &parameter2, const QString &parameter3, const QString &parameter4, const QString &parameter5,
@@ -1076,6 +1083,8 @@ bool Component::addElevatedOperation(const QString &operation, const QStringList
Specifies whether operations should be automatically created when the installation starts. This
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.
+
+ \sa {component::autoCreateOperations}{component.autoCreateOperations}
*/
bool Component::autoCreateOperations() const
{
@@ -1133,6 +1142,7 @@ bool Component::validatePage()
/*!
Adds the component specified by \a newDependency to the list of dependencies.
+ \sa {component::addDependency}{component.addDependency}
\sa dependencies
*/
@@ -1156,8 +1166,7 @@ QStringList Component::autoDependencies() const
}
/*!
-
- Sets the component's state to installed.
+ \sa {component::setInstalled}{component.setInstalled}
*/
void Component::setInstalled()
{
@@ -1168,6 +1177,8 @@ void Component::setInstalled()
Determines whether the component comes as an auto dependency. Returns \c true if all components
in \a componentsToInstall are already installed or selected for installation and this component
thus needs to be installed as well.
+
+ \sa {component::isAutoDependOn}{component.isAutoDependOn}
*/
bool Component::isAutoDependOn(const QSet<QString> &componentsToInstall) const
{
@@ -1227,7 +1238,9 @@ bool Component::isInstalled() const
}
/*!
- Returns whether the user wants to install the component
+ Returns whether the user wants to install the component.
+
+ \sa {component::installationRequested}{component.installationRequested}
*/
bool Component::installationRequested() const
{
@@ -1244,6 +1257,8 @@ bool Component::isSelectedForInstallation() const
/*!
Sets the \a isUpdateAvailable flag to \c true to indicate that the core found an update.
+
+ \sa {component::setUpdateAvailable}{component.setUpdateAvailable}
*/
void Component::setUpdateAvailable(bool isUpdateAvailable)
{
@@ -1251,7 +1266,9 @@ void Component::setUpdateAvailable(bool isUpdateAvailable)
}
/*!
- Returns whether the user wants to install the update for this component
+ Returns whether the user wants to install the update for this component.
+
+ \sa {component::updateRequested}{component.updateRequested}
*/
bool Component::updateRequested()
{
@@ -1260,6 +1277,8 @@ bool Component::updateRequested()
/*!
Returns \c true if that component will be changed (update, installation, or uninstallation).
+
+ \sa {component::componentChangeRequested}{component.componentChangeRequested}
*/
bool Component::componentChangeRequested()
{
@@ -1268,7 +1287,7 @@ bool Component::componentChangeRequested()
/*!
- Sets the component state to uninstalled.
+ \sa {component::setUninstalled}{component.setUninstalled}
*/
void Component::setUninstalled()
{
@@ -1277,6 +1296,8 @@ void Component::setUninstalled()
/*!
Returns whether the component is uninstalled.
+
+ \sa {component::isUninstalled}{component.isUninstalled}
*/
bool Component::isUninstalled() const
{
@@ -1285,6 +1306,8 @@ bool Component::isUninstalled() const
/*!
Returns whether the user wants to uninstall the component.
+
+ \sa {component::uninstallationRequested}{component.uninstallationRequested}
*/
bool Component::uninstallationRequested() const
{
@@ -1296,7 +1319,8 @@ bool Component::uninstallationRequested() const
/*!
Returns whether this component has been loaded from an online repository.
- \sa addDownloadableArchive, fromOnlineRepository
+ \sa {component::isFromOnlineRepository}{component.isFromOnlineRepository}
+ \sa addDownloadableArchive(), fromOnlineRepository
*/
bool Component::isFromOnlineRepository() const
{