aboutsummaryrefslogtreecommitdiff
path: root/lib/configuration
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-12-30 16:10:17 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-12-30 16:10:17 +0100
commitd5b4433c44f99bb30a6282c247de3938f3f8c987 (patch)
tree0a3f68a5d0fea8050d25da4a837107ae5700de27 /lib/configuration
parentAdd smolbote.5 manpage (diff)
downloadsmolbote-d5b4433c44f99bb30a6282c247de3938f3f8c987.tar.xz
Fix filter.header not working
Diffstat (limited to 'lib/configuration')
-rw-r--r--lib/configuration/configuration.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/configuration/configuration.h b/lib/configuration/configuration.h
index 4f9eafd..2bdd2c5 100644
--- a/lib/configuration/configuration.h
+++ b/lib/configuration/configuration.h
@@ -44,13 +44,14 @@ public:
return std::nullopt;
}
+ // path is guaranteed to exist, so using vm[path] is safe
+
if constexpr(std::is_same_v<T, QString>) {
- return std::optional<QString>(QString::fromStdString(this->value<std::string>(path).value()));
- //return std::optional<QString>(vm[path].as<const char*>());
+ return std::optional<QString>(QString::fromStdString(vm[path].as<std::string>()));
} else if constexpr(std::is_same_v<T, QStringList>) {
QStringList r;
- for(const std::string &item : this->value<std::vector<std::string>>(path).value()) {
+ for(const std::string &item : vm[path].as<std::vector<std::string>>()) {
r.append(QString::fromStdString(item));
}
return std::optional<QStringList>(r);