From d07ddc8009502f995d27d6cdce110a5c90779806 Mon Sep 17 00:00:00 2001 From: poljvd Date: Wed, 16 Oct 2013 18:13:31 +0200 Subject: [PATCH] Check type case insensitive Former-commit-id: 07cebb35933bba53012b7f05bc467f11a28bcc8c --- libsrc/bootsequence/BootSequenceFactory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libsrc/bootsequence/BootSequenceFactory.cpp b/libsrc/bootsequence/BootSequenceFactory.cpp index 50c2cdf2..c47fed6e 100644 --- a/libsrc/bootsequence/BootSequenceFactory.cpp +++ b/libsrc/bootsequence/BootSequenceFactory.cpp @@ -1,3 +1,6 @@ +// stl includes +#include +#include // Bootsequence includes #include @@ -8,7 +11,8 @@ BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, const Json::Value & jsonConfig) { - const std::string type = jsonConfig["type"].asString(); + std::string type = jsonConfig["type"].asString(); + std::transform(type.begin(), type.end(), type.begin(), std::tolower); if (type == "none") { @@ -19,7 +23,7 @@ BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, cons const unsigned duration_ms = jsonConfig["duration_ms"].asUInt(); return new RainbowBootSequence(hyperion, duration_ms); } - else if (type == "knightrider") + else if (type == "knightrider" || type == "knight rider") { const unsigned duration_ms = jsonConfig["duration_ms"].asUInt(); return new KittBootSequence(hyperion, duration_ms);