From 03e50d4d7aa62dc1a225bcf79689e1a4dfdf72fe Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 7 Sep 2023 13:38:03 +0200 Subject: [PATCH] Python: fix unguarded optional access Change-Id: I4131343aab2f193336e81f2e76cbb95ef3ff2805 Reviewed-by: Christian Stenger --- src/plugins/python/pyside.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/python/pyside.cpp b/src/plugins/python/pyside.cpp index a2f1cac2fc1..896620ae32e 100644 --- a/src/plugins/python/pyside.cpp +++ b/src/plugins/python/pyside.cpp @@ -104,7 +104,7 @@ void PySideInstaller::installPyside(const FilePath &python, if (success) emit pySideInstalled(python, pySide); }); - if (qtInstallDir->isEmpty()) { + if (availablePySides.isEmpty()) { install->setPackages({PipPackage(pySide)}); } else { QDialog dialog; @@ -113,7 +113,7 @@ void PySideInstaller::installPyside(const FilePath &python, dialog.layout()->addWidget(new QLabel(Tr::tr("Select which PySide version to install:"))); QComboBox *pySideSelector = new QComboBox(); pySideSelector->addItem(Tr::tr("Latest PySide from the Python Package Index")); - for (const Utils::FilePath &version : availablePySides) { + for (const Utils::FilePath &version : std::as_const(availablePySides)) { const FilePath dir = version.parentDir(); const QString text = Tr::tr("PySide %1 wheel (%2)").arg(dir.fileName(), dir.toUserOutput());