summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-12-30 11:56:35 +0200
committerKatja Marttila <katja.marttila@qt.io>2021-01-14 22:41:13 +0200
commit3daae29e295e3220f6aba001fe799a330e36c52e (patch)
tree11470d679c744561d750fac23c7f0d245a3b324c
parent611265e5ca030ff358ebae444d7fb313e9ce47a7 (diff)
Allow disabling undo in CreateLocalRepository operation during uninstall
Task-number: QTIFW-2094 Change-Id: I1c5d86e084eac9760ac734ae62d6d7706e57dff2 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r--doc/operations.qdoc3
-rw-r--r--src/libs/installer/createlocalrepositoryoperation.cpp6
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/operations.qdoc b/doc/operations.qdoc
index 1df1de39d..a01446a69 100644
--- a/doc/operations.qdoc
+++ b/doc/operations.qdoc
@@ -252,6 +252,9 @@
\li Creates a local repository in the directory specified by
\c repoPath. For offline installers, stores binary data in the
directory specified by \c binaryPath.
+ \note The repository will be deleted during uninstallation. If you want keep
+ the repository, you can overwrite the \e UNDO by passing \e UNDOOPERATION
+ and \e "", to the end of the argument list.
\row
\li FakeStopProcessForUpdate
\li "FakeStopProcessForUpdate" \c processlist
diff --git a/src/libs/installer/createlocalrepositoryoperation.cpp b/src/libs/installer/createlocalrepositoryoperation.cpp
index 1d194e5b3..e05c34b91 100644
--- a/src/libs/installer/createlocalrepositoryoperation.cpp
+++ b/src/libs/installer/createlocalrepositoryoperation.cpp
@@ -374,7 +374,11 @@ bool CreateLocalRepositoryOperation::performOperation()
bool CreateLocalRepositoryOperation::undoOperation()
{
- Q_ASSERT(arguments().count() == 2);
+ if (parseUndoOperationArguments().count() > 0)
+ return true;
+
+ if (!checkArgumentCount(2))
+ return false;
AutoHelper _(this);
emit progressChanged(0.0);