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