From 3acc4e966025ea174fd873c4f29f76b6dfed9b4b Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Thu, 21 Jan 2021 09:01:58 +0200 Subject: Save Execute operation with predefined variable When operations are saved to dat file, the variables are resolved making it impossible to change it afterwards. This change allows saving the Execute -operation variables unresolved. Variables are resolved runtime so those can be changed using e.g. script. Task-number: QTIFW-2124 Change-Id: I22a0502a5760234fc331aa931b8c66864e855e34 Reviewed-by: Arttu Tarkiainen --- src/libs/installer/component.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/libs/installer/component.cpp') diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 4d614d242..2e797944b 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -1096,7 +1096,13 @@ Operation *Component::createOperation(const QString &operationName, const QStrin if (operation->name() == QLatin1String("Delete")) operation->setValue(QLatin1String("performUndo"), false); - operation->setArguments(d->m_core->replaceVariables(parameters)); + // Operation can contain variables which are resolved when performing the operation + if (operation->requiresUnreplacedVariables()) + operation->setArguments(parameters); + else + operation->setArguments(d->m_core->replaceVariables(parameters)); + + operation->setValue(QLatin1String("component"), name()); return operation; } -- cgit v1.2.3