Replace boost::optional with std::optional (#4877)
This commit is contained in:
@@ -312,9 +312,9 @@ void NativeMessagingServer::syncChannels(const QJsonArray &twitchChannels)
|
||||
this->channelWarmer_ = std::move(updated);
|
||||
}
|
||||
|
||||
Atomic<boost::optional<QString>> &nmIpcError()
|
||||
Atomic<std::optional<QString>> &nmIpcError()
|
||||
{
|
||||
static Atomic<boost::optional<QString>> x;
|
||||
static Atomic<std::optional<QString>> x;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include "common/Atomic.hpp"
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <QString>
|
||||
#include <QThread>
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
namespace chatterino {
|
||||
@@ -19,7 +19,7 @@ using ChannelPtr = std::shared_ptr<Channel>;
|
||||
void registerNmHost(Paths &paths);
|
||||
std::string &getNmQueueName(Paths &paths);
|
||||
|
||||
Atomic<boost::optional<QString>> &nmIpcError();
|
||||
Atomic<std::optional<QString>> &nmIpcError();
|
||||
|
||||
namespace nm::client {
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ void Paths::initCheckPortable()
|
||||
|
||||
void Paths::initRootDirectory()
|
||||
{
|
||||
assert(this->portable_.is_initialized());
|
||||
assert(this->portable_.has_value());
|
||||
|
||||
// Root path = %APPDATA%/Chatterino or the folder that the executable
|
||||
// resides in
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <QString>
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Paths
|
||||
@@ -51,7 +52,7 @@ private:
|
||||
void initRootDirectory();
|
||||
void initSubDirectories();
|
||||
|
||||
boost::optional<bool> portable_;
|
||||
std::optional<bool> portable_;
|
||||
|
||||
// Directory for cache files. Same as <appDataDirectory>/Misc
|
||||
QString cacheDirectory_;
|
||||
|
||||
@@ -87,7 +87,7 @@ bool Settings::isMutedChannel(const QString &channelName)
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::optional<QString> Settings::matchNickname(const QString &usernameText)
|
||||
std::optional<QString> Settings::matchNickname(const QString &usernameText)
|
||||
{
|
||||
auto nicknames = this->nicknames.readOnly();
|
||||
|
||||
@@ -99,7 +99,7 @@ boost::optional<QString> Settings::matchNickname(const QString &usernameText)
|
||||
}
|
||||
}
|
||||
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void Settings::mute(const QString &channelName)
|
||||
|
||||
@@ -593,7 +593,7 @@ public:
|
||||
bool isBlacklistedUser(const QString &username);
|
||||
bool isMutedChannel(const QString &channelName);
|
||||
bool toggleMutedChannel(const QString &channelName);
|
||||
boost::optional<QString> matchNickname(const QString &username);
|
||||
std::optional<QString> matchNickname(const QString &username);
|
||||
|
||||
private:
|
||||
void mute(const QString &channelName);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "widgets/splits/SplitContainer.hpp"
|
||||
#include "widgets/Window.hpp"
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
@@ -34,13 +33,14 @@
|
||||
#include <QScreen>
|
||||
|
||||
#include <chrono>
|
||||
#include <optional>
|
||||
|
||||
namespace chatterino {
|
||||
namespace {
|
||||
|
||||
boost::optional<bool> &shouldMoveOutOfBoundsWindow()
|
||||
std::optional<bool> &shouldMoveOutOfBoundsWindow()
|
||||
{
|
||||
static boost::optional<bool> x;
|
||||
static std::optional<bool> x;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user