Replace boost::optional with std::optional (#4877)

This commit is contained in:
pajlada
2023-10-08 18:50:48 +02:00
committed by GitHub
parent fe4d6121a2
commit fec45889a8
88 changed files with 428 additions and 383 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ int HotkeyController::replaceHotkey(QString oldName,
return this->hotkeys_.append(newHotkey);
}
boost::optional<HotkeyCategory> HotkeyController::hotkeyCategoryFromName(
std::optional<HotkeyCategory> HotkeyController::hotkeyCategoryFromName(
QString categoryName)
{
for (const auto &[category, data] : this->categories())
+1 -3
View File
@@ -4,7 +4,6 @@
#include "common/Singleton.hpp"
#include "controllers/hotkeys/HotkeyCategory.hpp"
#include <boost/optional.hpp>
#include <pajlada/signals/signal.hpp>
#include <pajlada/signals/signalholder.hpp>
@@ -52,8 +51,7 @@ public:
* @returns the new index in the SignalVector
**/
int replaceHotkey(QString oldName, std::shared_ptr<Hotkey> newHotkey);
boost::optional<HotkeyCategory> hotkeyCategoryFromName(
QString categoryName);
std::optional<HotkeyCategory> hotkeyCategoryFromName(QString categoryName);
/**
* @brief checks if the hotkey is duplicate
+3 -2
View File
@@ -3,9 +3,10 @@
#include "controllers/hotkeys/ActionNames.hpp"
#include "controllers/hotkeys/HotkeyCategory.hpp"
#include <boost/optional/optional.hpp>
#include <QStringList>
#include <optional>
namespace chatterino {
std::vector<QString> parseHotkeyArguments(QString argumentString)
@@ -31,7 +32,7 @@ std::vector<QString> parseHotkeyArguments(QString argumentString)
return arguments;
}
boost::optional<ActionDefinition> findHotkeyActionDefinition(
std::optional<ActionDefinition> findHotkeyActionDefinition(
HotkeyCategory category, const QString &action)
{
auto allActions = actionNames.find(category);
+2 -2
View File
@@ -2,15 +2,15 @@
#include "controllers/hotkeys/ActionNames.hpp"
#include <boost/optional/optional.hpp>
#include <QString>
#include <optional>
#include <vector>
namespace chatterino {
std::vector<QString> parseHotkeyArguments(QString argumentString);
boost::optional<ActionDefinition> findHotkeyActionDefinition(
std::optional<ActionDefinition> findHotkeyActionDefinition(
HotkeyCategory category, const QString &action);
} // namespace chatterino