diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-09-12 11:29:26 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-09-12 11:29:26 +0200 |
commit | 5c8b5588955450ab62ef1745bd4c823e7afc5e89 (patch) | |
tree | 822224d323b67253575aadaa1ded07317ea4cdf4 /src | |
parent | 2b546956a800545bdda2be9682fac21fd1e86736 (diff) |
layers: fix layers parsing, do not sort by prio
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/layers.cpp | 25 | ||||
-rw-r--r-- | src/layers.hpp | 4 |
2 files changed, 15 insertions, 14 deletions
diff --git a/src/layers.cpp b/src/layers.cpp index b931870..d0a769a 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -45,25 +45,24 @@ layer::layer(nlohmann::json const &j) { auto split_layouts = j.find("split_layouts"); if (split_layouts != j.end()) { auto &sls = j["split_layouts"]; - this->layouts.reserve(sls.size()); + // this->layouts.reserve(sls.size()); std::transform(std::cbegin(sls), std::cend(sls), - std::back_inserter(this->layouts), [](json const &sl) { - struct split_layout l {}; - l.name = sl["name"]; - l.main_match = sl["main_match"]; - l.sub_match = sl["sub_match"]; - l.prio = sl.value<int>("priority", 0); + std::back_inserter(this->layouts), [this](json const &sl) { + struct split_layout l { + sl["name"], sl["main_match"], sl["sub_match"], + sl.value<int>("priority", 0) + }; logdebug( - "Added split_layout \"%s\" (main: \"%s\") (sub: " - "\"%s\") (prio: %d)", + "layer %d add split_layout \"%s\" (main: \"%s\") (sub: " + "\"%s\") (prio: %d)", this->layer_id, l.name.c_str(), l.main_match.c_str(), l.sub_match.c_str(), l.prio); return l; }); - std::sort(std::begin(this->layouts), std::end(this->layouts), - [](struct split_layout const &a, struct split_layout const &b) { - return a.prio < b.prio; - }); + //std::sort(std::begin(this->layouts), std::end(this->layouts), + // [](struct split_layout const &a, struct split_layout const &b) { + // return a.prio < b.prio; + // }); } } diff --git a/src/layers.hpp b/src/layers.hpp index 924457f..0601614 100644 --- a/src/layers.hpp +++ b/src/layers.hpp @@ -18,6 +18,8 @@ #define TMCAGLWM_LAYERS_H #include <json.hpp> + +#include <regex> #include <set> #include <string> @@ -30,7 +32,7 @@ struct split_layout { std::string name; std::string main_match; std::string sub_match; - int prio; + int prio; // no entirely sure we will use this }; struct layer { |