summaryrefslogtreecommitdiffstats
path: root/src/sdk/sdkapp.h
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-03-11 18:35:05 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-03-19 06:56:52 +0200
commit8878f49cc00a5dcd0a8acd89cd5c9d8b89505941 (patch)
tree3db628af65c8f88067f8f49dcdedac1375fc1d38 /src/sdk/sdkapp.h
parentea8f8f2d8c9170dcf8c087786125db09c8d18dec (diff)
Refactor naming and usage of CLI commands
- Rename and alter the description of some command line options according to validation results from task QTIFW-1635. The suggested additions are not added in this change. - Remove options "framework-version" and "silentUpdate", these should not be needed anymore. - Combine options "installPackages" and "installDefault" into single "install" command. - Change command line syntax from "binary [options]" to "binary [options] command <arguments>". - Re-order & group known option variables and "--help" printing order based on their topic. - Move CommandLineParser class files under src/libs/installer and add private class for future options extension. Short versions of command line options should be added in a follow-up commit. Task-number: QTIFW-1671 Change-Id: Ie0d393368b5275c8ffa1ab8833885b149af3178e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/sdk/sdkapp.h')
-rw-r--r--src/sdk/sdkapp.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/sdk/sdkapp.h b/src/sdk/sdkapp.h
index 12a5aa830..ca52430d2 100644
--- a/src/sdk/sdkapp.h
+++ b/src/sdk/sdkapp.h
@@ -134,7 +134,7 @@ public:
QString loggingRules(QLatin1String("ifw.* = false")); // disable all by default
bool isCliInterface = false;
foreach (const QString &option, CommandLineOptions::scCommandLineInterfaceOptions) {
- if (m_parser.isSet(option)) {
+ if (m_parser.positionalArguments().contains(option)) {
isCliInterface = true;
break;
}
@@ -184,14 +184,12 @@ public:
BinaryFormatEngineHandler::instance()->registerResources(manager.collections());
}
- // From Qt5.8 onwards a separate command line option --proxy is not needed as system
- // proxy is used by default. If Qt is built with QT_USE_SYSTEM_PROXIES false
- // then system proxies are not used by default.
+ // From Qt5.8 onwards system proxy is used by default. If Qt is built with
+ // QT_USE_SYSTEM_PROXIES false then system proxies are not used by default.
if (m_parser.isSet(QLatin1String(CommandLineOptions::NoProxy))) {
m_core->settings().setProxyType(QInstaller::Settings::NoProxy);
KDUpdater::FileDownloaderFactory::instance().setProxyFactory(m_core->proxyFactory());
- } else if ((m_parser.isSet(QLatin1String(CommandLineOptions::Proxy))
- || QNetworkProxyFactory::usesSystemConfiguration())) {
+ } else if (QNetworkProxyFactory::usesSystemConfiguration()) {
m_core->settings().setProxyType(QInstaller::Settings::SystemProxy);
KDUpdater::FileDownloaderFactory::instance().setProxyFactory(m_core->proxyFactory());
}
@@ -199,7 +197,7 @@ public:
if (m_parser.isSet(QLatin1String(CommandLineOptions::ShowVirtualComponents)))
QInstaller::PackageManagerCore::setVirtualComponentsVisible(true);
- if (m_parser.isSet(QLatin1String(CommandLineOptions::Updater))) {
+ if (m_parser.isSet(QLatin1String(CommandLineOptions::StartUpdater))) {
if (m_core->isInstaller()) {
errorMessage = QObject::tr("Cannot start installer binary as updater.");
return false;
@@ -207,7 +205,7 @@ public:
m_core->setUserSetBinaryMarker(QInstaller::BinaryContent::MagicUpdaterMarker);
}
- if (m_parser.isSet(QLatin1String(CommandLineOptions::ManagePackages))) {
+ if (m_parser.isSet(QLatin1String(CommandLineOptions::StartPackageManager))) {
if (m_core->isInstaller()) {
errorMessage = QObject::tr("Cannot start installer binary as package manager.");
return false;
@@ -215,7 +213,7 @@ public:
m_core->setUserSetBinaryMarker(QInstaller::BinaryContent::MagicPackageManagerMarker);
}
- if (m_parser.isSet(QLatin1String(CommandLineOptions::Uninstaller))) {
+ if (m_parser.isSet(QLatin1String(CommandLineOptions::StartUninstaller))) {
if (m_core->isInstaller()) {
errorMessage = QObject::tr("Cannot start installer binary as uninstaller.");
return false;