diff options
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r-- | src/sdk/installerbase.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 32df0b550..ac2c9d367 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2024 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -97,18 +97,18 @@ int InstallerBase::run() if (status != QInstaller::PackageManagerCore::Success) return status; + m_core->saveGivenArguments(m_parser.optionNames()); + #ifdef ENABLE_SQUISH - int squishPort = 11233; if (m_parser.isSet(CommandLineOptions::scSquishPortLong)) { - squishPort = m_parser.value(CommandLineOptions::scSquishPortLong).toInt(); - } - if (squishPort != 0) { - if (Squish::allowAttaching(squishPort)) - qCDebug(QInstaller::lcDeveloperBuild) << "Attaching to squish port " << squishPort << " succeeded"; - else - qCDebug(QInstaller::lcDeveloperBuild) << "Attaching to squish failed."; - } else { - qCWarning(QInstaller::lcDeveloperBuild) << "Invalid squish port number: " << squishPort; + const int maxSquishPortNumber = 65535; + int squishPort = m_parser.value(CommandLineOptions::scSquishPortLong).toInt(); + if (squishPort <= 0 || squishPort > maxSquishPortNumber) { + qWarning().noquote() << "Invalid Squish port:" << squishPort; + } else { + bool attachSucceeded = Squish::allowAttaching(squishPort); + qCDebug(QInstaller::lcDeveloperBuild) << "Attach to squish port" << squishPort << "succeeded: "<<attachSucceeded; + } } #endif const int result = QCoreApplication::instance()->exec(); |