aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/updateinfo/updateinfotools.h
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2022-08-26 10:30:00 +0200
committerEike Ziller <eike.ziller@qt.io>2022-09-01 06:58:04 +0000
commit04e50438eb85c1b2be6d4dcdfd5319cdb55ae576 (patch)
tree4a3e9f078730bb538e2ca2751d189ff14a89901e /src/plugins/updateinfo/updateinfotools.h
parent34a9491a08639f8df0b55d74d51f4dadaa1cc2fd (diff)
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>
Diffstat (limited to 'src/plugins/updateinfo/updateinfotools.h')
-rw-r--r--src/plugins/updateinfo/updateinfotools.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/updateinfo/updateinfotools.h b/src/plugins/updateinfo/updateinfotools.h
index a5c3a816ee..1f79e366b6 100644
--- a/src/plugins/updateinfo/updateinfotools.h
+++ b/src/plugins/updateinfo/updateinfotools.h
@@ -4,7 +4,6 @@
#pragma once
#include <utils/algorithm.h>
-#include <utils/optional.h>
#include <QDomDocument>
#include <QList>
@@ -12,6 +11,8 @@
#include <QRegularExpression>
#include <QVersionNumber>
+#include <optional>
+
Q_DECLARE_LOGGING_CATEGORY(updateLog)
struct Update
@@ -90,7 +91,7 @@ QList<QtPackage> availableQtPackages(const QString &packageXml)
}
// Expects packages to be sorted, high version first.
-Utils::optional<QtPackage> highestInstalledQt(const QList<QtPackage> &packages)
+std::optional<QtPackage> highestInstalledQt(const QList<QtPackage> &packages)
{
const auto highestInstalledIt = std::find_if(packages.cbegin(),
packages.cend(),
@@ -101,7 +102,7 @@ Utils::optional<QtPackage> highestInstalledQt(const QList<QtPackage> &packages)
}
// Expects packages to be sorted, high version first.
-Utils::optional<QtPackage> qtToNagAbout(const QList<QtPackage> &allPackages,
+std::optional<QtPackage> qtToNagAbout(const QList<QtPackage> &allPackages,
QVersionNumber *highestSeen)
{
// Filter out any Qt prereleases
@@ -119,7 +120,7 @@ Utils::optional<QtPackage> qtToNagAbout(const QList<QtPackage> &allPackages,
*highestSeen = highest.version;
if (!isNew)
return {};
- const Utils::optional<QtPackage> highestInstalled = highestInstalledQt(packages);
+ const std::optional<QtPackage> highestInstalled = highestInstalledQt(packages);
qCDebug(updateLog) << "Highest installed Qt:"
<< qPrintable(highestInstalled ? highestInstalled->version.toString()
: QString("none"));