aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.cpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-25 09:44:07 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-25 01:33:51 +0000
commit714b578b8961b218841160e06df976863a2010d8 (patch)
treedd02040d17b8761c0f2c0bfa6407e158d77544dc /src/app.cpp
parentbe9cbe2c4d0bc0f65cbe08de2bad3eb6e7f248c0 (diff)
Clean: remove small files
*policy.hpp No affect to Window Manager decision, so remove it. *config.hpp, config.cpp Small function to hold the path information to config file, but no need to hold until the death of process. So move it to stack variable, then remove files. Change-Id: I6c210acc586c7cc048e0b158df5e3a511f927b9d Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/app.cpp b/src/app.cpp
index e7048c4..f83e3e7 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -89,17 +89,26 @@ App::App(wl::display *d)
display{d},
controller{},
outputs(),
- config(),
layers(),
id_alloc{},
- pending_events(false),
- policy{}
+ pending_events(false)
{
+ char const *path_layers_json = getenv("AFM_APP_INSTALL_DIR");
+ std::string path;
+ if (!path_layers_json)
+ {
+ HMI_ERROR("wm", "AFM_APP_INSTALL_DIR is not defined");
+ path = std::string(path_layers_json);
+ }
+ else
+ {
+ path = std::string(path_layers_json) + std::string("/etc/layers.json");
+ }
+
try
{
{
- auto l = load_layer_map(
- this->config.get_string("layers.json").value().c_str());
+ auto l = load_layer_map(path.c_str());
if (l.is_ok())
{
this->layers = l.unwrap();
@@ -1072,10 +1081,7 @@ void App::try_layout(struct LayoutState & /*state*/,
struct LayoutState const &new_layout,
std::function<void(LayoutState const &nl)> apply)
{
- if (this->policy.layout_is_valid(new_layout))
- {
- apply(new_layout);
- }
+ apply(new_layout);
}
/**