forked from qt-creator/qt-creator
Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/optional.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
@@ -36,6 +35,8 @@
|
||||
#include <QHelpEngine>
|
||||
#include <QMutexLocker>
|
||||
|
||||
#include <optional>
|
||||
|
||||
using namespace Help::Internal;
|
||||
|
||||
static LocalHelpManager *m_instance = nullptr;
|
||||
@@ -279,7 +280,7 @@ void LocalHelpManager::setLastSelectedTab(int index)
|
||||
Core::ICore::settings()->setValueWithDefault(kLastSelectedTabKey, index, -1);
|
||||
}
|
||||
|
||||
static Utils::optional<HelpViewerFactory> backendForId(const QByteArray &id)
|
||||
static std::optional<HelpViewerFactory> backendForId(const QByteArray &id)
|
||||
{
|
||||
const QVector<HelpViewerFactory> factories = LocalHelpManager::viewerBackends();
|
||||
const auto backend = std::find_if(std::begin(factories),
|
||||
@@ -294,7 +295,7 @@ HelpViewerFactory LocalHelpManager::defaultViewerBackend()
|
||||
{
|
||||
const QString backend = Utils::qtcEnvironmentVariable("QTC_HELPVIEWER_BACKEND");
|
||||
if (!backend.isEmpty()) {
|
||||
const Utils::optional<HelpViewerFactory> factory = backendForId(backend.toLatin1());
|
||||
const std::optional<HelpViewerFactory> factory = backendForId(backend.toLatin1());
|
||||
if (factory)
|
||||
return *factory;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user