#include "configuration.h" template <> [[nodiscard]] std::optional Configuration::value(const char *path, std::source_location location) const { const auto result = value(path, location); return result ? std::make_optional(QString::fromStdString(result.value())) : std::nullopt; } template <> [[nodiscard]] std::optional Configuration::value(const char *path, std::source_location location) const { const auto result = value(path, location); return result ? std::make_optional(QString::fromStdString(result.value()).split(';')) : std::nullopt; } template <> QAction &Configuration::shortcut(QAction &action, const char *name, const std::source_location location) const { if(const auto result = value(name, location)) { const QString old_tooltip = action.toolTip(); const auto &result_value = result.value(); action.setShortcut(QKeySequence::fromString(result_value)); action.setToolTip(QString("%1 (%2)").arg(old_tooltip, result_value)); } return action; } template <> QKeySequence &Configuration::shortcut(QKeySequence &sequence, const char *name, const std::source_location location) const { if(const auto result = value(name, location)) { const auto &result_value = result.value(); sequence = QKeySequence::fromString(result_value); } return sequence; }