Replace boost::optional with std::optional (#4877)
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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,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,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
|
||||
|
||||
Reference in New Issue
Block a user