summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-05-27 15:29:15 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-05-29 12:16:21 +0000
commit3557b1650c1c4f71947da0ec78e38ffe436f0cb0 (patch)
tree3fa239a015c9bc5b5ae05ba6567d0c2d6776b9b6 /doc
parent096238ca83e401c17677e7948ac7fec2dddedb46 (diff)
Doc: Clarify use of addOperation
Make it explicit that addOperation , addElevatedOperation should be usually called from within createOperations(). Change-Id: Id14339b1259716825a9443cc563449025674976f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/scripting-api/component.qdoc28
-rw-r--r--doc/scripting.qdoc4
2 files changed, 23 insertions, 9 deletions
diff --git a/doc/scripting-api/component.qdoc b/doc/scripting-api/component.qdoc
index 56e97f483..8e38c7e92 100644
--- a/doc/scripting-api/component.qdoc
+++ b/doc/scripting-api/component.qdoc
@@ -250,12 +250,20 @@
\qmlmethod void component::createOperations()
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.
+ 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.
+ \code
+ Component.prototype.createOperations = function()
+ {
+ // call default implementation
+ component.createOperations();
+ // ... add custom operations
+ }
+ \endcode
The default implementation calls createOperationsForArchive for all archives in this component.
+
+ \sa component::addOperation()
*/
/*!
@@ -307,17 +315,19 @@
*/
/*!
- \qmlmethod boolean component::addOperation(string operation, string parameter1 = "", string parameter2 = "", ..., string parameter10 = "")
-
- Convenience method for calling addOperation(string, stringlist) with up to 10 arguments.
-*/
-
-/*!
\qmlmethod boolean component::addOperation(string operation, stringlist parameters)
Creates and adds an installation operation for \a operation. Add any number of parameters.
The contents of the parameters get variables like "@TargetDir@" replaced with their values,
if contained.
+
+ The method is typically called from within \l component::createOperations().
+*/
+
+/*!
+ \qmlmethod boolean component::addOperation(string operation, string parameter1 = "", string parameter2 = "", ..., string parameter10 = "")
+
+ Convenience method for calling addOperation(string, stringlist) with up to 10 arguments.
*/
/*!
diff --git a/doc/scripting.qdoc b/doc/scripting.qdoc
index 9199d40e0..f4fc344e5 100644
--- a/doc/scripting.qdoc
+++ b/doc/scripting.qdoc
@@ -121,6 +121,10 @@
component::addOperation(). If you need to run an operation that requires
administrative rights, use component::addElevatedOperation() instead.
+ Operations need to be added before the actual installation step. Override
+ \l component::createOperations() to register custom operations for a
+ component.
+
Each operation has a unique key used for identification and can take up to
five parameters. In the parameter values, you can use variables as set in
installer::setValue(). For more information, see \l{Predefined Variables}.