diff options
Diffstat (limited to 'src/libs/installer/utils.cpp')
-rw-r--r-- | src/libs/installer/utils.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/libs/installer/utils.cpp b/src/libs/installer/utils.cpp index d47caea89..e3a18100b 100644 --- a/src/libs/installer/utils.cpp +++ b/src/libs/installer/utils.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -183,6 +183,23 @@ uint QInstaller::verboseLevel() } /*! + Returns a list of mutually exclusive options passed to the \a parser, if there is + at least one mutually exclusive pair of options set. Otherwise returns an empty + \c QStringList. The options considered mutual are provided with \a options. +*/ +QStringList QInstaller::checkMutualOptions(CommandLineParser &parser, const QStringList &options) +{ + QStringList mutual; + foreach (const QString &option, options) { + if (parser.isSet(option)) + mutual << option; + } + return mutual.count() > 1 + ? mutual + : QStringList(); +} + +/*! \internal */ std::ostream &QInstaller::operator<<(std::ostream &os, const QString &string) @@ -512,5 +529,3 @@ QString QInstaller::windowsErrorString(int errorCode) } #endif - - |