diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 0b97430a1f6..426fb392f6c 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -1376,7 +1376,7 @@ static QList createCppPluginsFromArchive(const FilePath &path) it.next(); expected_str spec = readCppPluginSpec(FilePath::fromUserInput(it.filePath())); if (spec) - results.push_back(spec.value()); + results.push_back(*spec); } return results; } diff --git a/src/libs/gocmdbridge/client/bridgedfileaccess.cpp b/src/libs/gocmdbridge/client/bridgedfileaccess.cpp index 12ffcd8e7fa..da76205ab53 100644 --- a/src/libs/gocmdbridge/client/bridgedfileaccess.cpp +++ b/src/libs/gocmdbridge/client/bridgedfileaccess.cpp @@ -73,7 +73,7 @@ expected_str FileAccess::deployAndInit( return make_unexpected( QString("Could not determine OS on remote host: %1").arg(unameOs.error())); } - Utils::expected_str osType = osTypeFromString(unameOs.value()); + Utils::expected_str osType = osTypeFromString(*unameOs); if (!osType) return make_unexpected(osType.error()); @@ -85,7 +85,7 @@ expected_str FileAccess::deployAndInit( QString("Could not determine architecture on remote host: %1").arg(unameArch.error())); } - const Utils::expected_str osArch = osArchFromString(unameArch.value()); + const Utils::expected_str osArch = osArchFromString(*unameArch); if (!osArch) return make_unexpected(osArch.error()); diff --git a/src/plugins/autotest/testresultdelegate.cpp b/src/plugins/autotest/testresultdelegate.cpp index f50a8dcf4a7..d7fdbb5a473 100644 --- a/src/plugins/autotest/testresultdelegate.cpp +++ b/src/plugins/autotest/testresultdelegate.cpp @@ -91,7 +91,7 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op } if (testResult.result() == ResultType::TestStart && m_showDuration && testResult.duration()) { - const QString txt = testResult.duration().value() + " ms"; + const QString txt = *testResult.duration() + " ms"; QPen tmp = painter->pen(); painter->setPen(opt.palette.mid().color()); painter->setClipRect(positions.durationArea()); diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 5544a6242de..de08e21895c 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -806,7 +806,7 @@ Group issueTableRecipe(const IssueListSearch &search, const IssueTableHandler &h if (query.isEmpty()) return {}; // TODO: Call handler with unexpected? - const QUrl url = constructUrl(dd->m_currentProjectInfo.value().name, "issues", query); + const QUrl url = constructUrl(dd->m_currentProjectInfo->name, "issues", query); return fetchDataRecipe(url, handler); } @@ -818,7 +818,7 @@ Group lineMarkerRecipe(const FilePath &filePath, const LineMarkerHandler &handle const QString fileName = QString::fromUtf8(QUrl::toPercentEncoding(filePath.path())); const QUrlQuery query({{"filename", fileName}, {"version", *dd->m_analysisVersion}}); - const QUrl url = constructUrl(dd->m_currentProjectInfo.value().name, "files", query); + const QUrl url = constructUrl(dd->m_currentProjectInfo->name, "files", query); return fetchDataRecipe(url, handler); } @@ -830,7 +830,7 @@ Group fileSourceRecipe(const FilePath &filePath, const std::functionm_analysisVersion}}); - const QUrl url = constructUrl(dd->m_currentProjectInfo.value().name, "sourcecode", query); + const QUrl url = constructUrl(dd->m_currentProjectInfo->name, "sourcecode", query); return fetchPlainTextRecipe(url, handler); } @@ -839,9 +839,10 @@ Group issueHtmlRecipe(const QString &issueId, const HtmlHandler &handler) QTC_ASSERT(dd->m_currentProjectInfo, return {}); // TODO: Call handler with unexpected? QTC_ASSERT(dd->m_analysisVersion, return {}); // TODO: Call handler with unexpected? - const QUrl url = constructUrl(dd->m_currentProjectInfo.value().name, - QString("issues/" + issueId + "/properties/"), - {{"version", *dd->m_analysisVersion}}); + const QUrl url = constructUrl( + dd->m_currentProjectInfo->name, + QString("issues/" + issueId + "/properties/"), + {{"version", *dd->m_analysisVersion}}); return fetchHtmlRecipe(url, handler); } @@ -894,7 +895,7 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName) Group tableInfoRecipe(const QString &prefix, const TableInfoHandler &handler) { const QUrlQuery query({{"kind", prefix}}); - const QUrl url = constructUrl(dd->m_currentProjectInfo.value().name, "issues_meta", query); + const QUrl url = constructUrl(dd->m_currentProjectInfo->name, "issues_meta", query); return fetchDataRecipe(url, handler); } diff --git a/src/plugins/axivion/issueheaderview.cpp b/src/plugins/axivion/issueheaderview.cpp index d2b049bd32a..444a4505c5d 100644 --- a/src/plugins/axivion/issueheaderview.cpp +++ b/src/plugins/axivion/issueheaderview.cpp @@ -142,7 +142,7 @@ static QIcon iconForSorted(std::optional order) if (!order) return unsorted; - return order.value() == Qt::AscendingOrder ? sortedAsc : sortedDesc; + return *order == Qt::AscendingOrder ? sortedAsc : sortedDesc; } static QIcon iconForFilter(bool isActive) @@ -173,7 +173,7 @@ QList> IssueHeaderView::currentSortColumns() const { QList> result; for (int i : m_currentSortIndexes) - result.append({i, m_columnInfoList.at(i).sortOrder.value()}); + result.append({i, *m_columnInfoList.at(i).sortOrder}); return result; } @@ -183,7 +183,7 @@ QList> IssueHeaderView::currentFilterColumns() const for (int i = 0, end = m_columnInfoList.size(); i < end; ++i) { const ColumnInfo ci = m_columnInfoList.at(i); if (ci.filter.has_value()) - result.append({i, ci.filter.value()}); + result.append({i, *ci.filter}); } return result; } @@ -225,7 +225,7 @@ void IssueHeaderView::mousePressEvent(QMouseEvent *event) void IssueHeaderView::mouseReleaseEvent(QMouseEvent *event) { bool dontSkip = !m_dragging && m_maybeToggle; - const int toggleMode = m_maybeToggle ? m_maybeToggle.value() : -1; + const int toggleMode = m_maybeToggle ? *m_maybeToggle : -1; bool withShift = m_withShift && event->modifiers() == Qt::ShiftModifier; m_dragging = false; m_maybeToggle.reset(); diff --git a/src/plugins/clangformat/clangformatfile.cpp b/src/plugins/clangformat/clangformatfile.cpp index 4db8eb1ba72..8b89eed027f 100644 --- a/src/plugins/clangformat/clangformatfile.cpp +++ b/src/plugins/clangformat/clangformatfile.cpp @@ -35,7 +35,7 @@ ClangFormatFile::ClangFormatFile( 0, "# yaml-language-server: " "$schema=https://json.schemastore.org/clang-format.json\n"); - m_filePath.writeFileContents(fileContent.value()); + m_filePath.writeFileContents(*fileContent); } parseConfigurationFile(m_filePath, m_style); return; diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 359ca9aa4af..6945e07a887 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -856,7 +856,7 @@ QStringList DockerDevicePrivate::createMountArgs() const mounts.append({m, m}); if (cmdBridgePath && cmdBridgePath->isSameDevice(settings().dockerBinaryPath())) - mounts.append({cmdBridgePath.value(), FilePath("/tmp/_qtc_cmdbridge")}); + mounts.append({*cmdBridgePath, FilePath("/tmp/_qtc_cmdbridge")}); for (const MountPair &mi : mounts) { if (isValidMountInfo(mi)) @@ -1363,7 +1363,7 @@ expected_str DockerDevicePrivate::environment() } QTC_ASSERT(m_cachedEnviroment, return {}); - return m_cachedEnviroment.value(); + return *m_cachedEnviroment; } void DockerDevicePrivate::shutdown() diff --git a/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp b/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp index 0bb479795ed..b8735bca5e7 100644 --- a/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp +++ b/tests/auto/extensionsystem/pluginspec/tst_pluginspec.cpp @@ -237,7 +237,7 @@ void tst_PluginSpec::locationAndPath() Utils::expected_str ps = readCppPluginSpec( PLUGIN_DIR_PATH / "testplugin" / libraryName(QLatin1String("test"))); QVERIFY(ps); - CppPluginSpec *spec = static_cast(ps.value()); + CppPluginSpec *spec = static_cast(*ps); QCOMPARE(spec->location(), PLUGIN_DIR_PATH / "testplugin"); QCOMPARE(spec->filePath(), PLUGIN_DIR_PATH / "testplugin" / libraryName(QLatin1String("test"))); } @@ -292,7 +292,7 @@ void tst_PluginSpec::loadLibrary() PLUGIN_DIR_PATH / "testplugin" / libraryName(QLatin1String("test"))); QVERIFY(ps); - CppPluginSpec *spec = static_cast(ps.value()); + CppPluginSpec *spec = static_cast(*ps); QCOMPARE(spec->errorString(), QString()); QVERIFY(spec->resolveDependencies({})); @@ -311,7 +311,7 @@ void tst_PluginSpec::initializePlugin() Utils::expected_str ps = readCppPluginSpec( PLUGIN_DIR_PATH / "testplugin" / libraryName(QLatin1String("test"))); QVERIFY(ps); - CppPluginSpec *spec = static_cast(ps.value()); + CppPluginSpec *spec = static_cast(*ps); QVERIFY(spec->resolveDependencies({})); QVERIFY2(spec->loadLibrary(), qPrintable(spec->errorString())); bool isInitialized; @@ -335,7 +335,7 @@ void tst_PluginSpec::initializeExtensions() Utils::expected_str ps = readCppPluginSpec( PLUGIN_DIR_PATH / "testplugin" / libraryName(QLatin1String("test"))); QVERIFY(ps); - CppPluginSpec *spec = static_cast(ps.value()); + CppPluginSpec *spec = static_cast(*ps); QVERIFY(spec->resolveDependencies({})); QVERIFY2(spec->loadLibrary(), qPrintable(spec->errorString())); bool isExtensionsInitialized;