X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fconfig.cpp;h=7b18224c5c0aeb6a52f5235ffd24ba91f01d3f66;hb=358f8b12f6d858473b0bfbd6ed9b191cd94f7b02;hp=d5a549a947f93adc970ea196ddbcb41e73d989c8;hpb=074d058a7a483a66af7f8c0b928b321ad483f47c;p=apps%2Fagl-service-windowmanager.git diff --git a/src/config.cpp b/src/config.cpp index d5a549a..7b18224 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Mentor Graphics Development (Deutschland) GmbH + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,24 @@ */ #include "config.hpp" +#include "hmi-debug.h" -namespace wm { +namespace wm +{ -config::config() : cfg() { - // Supply default values for these... - this->cfg["layers.json"] = getenv("LAYERS_JSON") ?: "/etc/windowmanager/layers.json"; +config::config() : cfg() +{ + // Supply default values for these... + char const *path_layers_json = getenv("AFM_APP_INSTALL_DIR"); + + if (!path_layers_json) + { + HMI_ERROR("wm", "AFM_APP_INSTALL_DIR is not defined"); + } + else + { + this->cfg["layers.json"] = std::string(path_layers_json) + std::string("/etc/layers.json"); + } } -} // namespace wm +} // namespace wm