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:
@@ -244,7 +244,7 @@ bool LiteHtmlHelpViewer::eventFilter(QObject *src, QEvent *e)
|
||||
return HelpViewer::eventFilter(src, e);
|
||||
}
|
||||
|
||||
void LiteHtmlHelpViewer::setSourceInternal(const QUrl &url, Utils::optional<int> vscroll)
|
||||
void LiteHtmlHelpViewer::setSourceInternal(const QUrl &url, std::optional<int> vscroll)
|
||||
{
|
||||
slotLoadStarted();
|
||||
QUrl currentUrlWithoutFragment = m_viewer->url();
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
#include "helpviewer.h"
|
||||
#include "openpagesmanager.h"
|
||||
|
||||
#include <utils/optional.h>
|
||||
|
||||
#include <qlitehtmlwidget.h>
|
||||
|
||||
#include <QTextBrowser>
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace Help {
|
||||
namespace Internal {
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
private:
|
||||
void goForward(int count);
|
||||
void goBackward(int count);
|
||||
void setSourceInternal(const QUrl &url, Utils::optional<int> vscroll = Utils::nullopt);
|
||||
void setSourceInternal(const QUrl &url, std::optional<int> vscroll = std::nullopt);
|
||||
void showContextMenu(const QPoint &pos, const QUrl &url);
|
||||
|
||||
struct HistoryItem
|
||||
|
||||
@@ -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