From 3557b1650c1c4f71947da0ec78e38ffe436f0cb0 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 27 May 2015 15:29:15 +0200 Subject: 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 --- doc/scripting-api/component.qdoc | 28 +++++++++++++++++++--------- doc/scripting.qdoc | 4 ++++ 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() */ /*! @@ -306,18 +314,20 @@ (remove). */ -/*! - \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}. -- cgit v1.2.3