Code Review
/
apps
/
agl-service-homescreen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
add lastmode function
[apps/agl-service-homescreen.git]
/
src
/
hs-config.cpp
diff --git
a/src/hs-config.cpp
b/src/hs-config.cpp
index
b8f9f5b
..
c0d6942
100644
(file)
--- a/
src/hs-config.cpp
+++ b/
src/hs-config.cpp
@@
-22,6
+22,10
@@
const std::array<std::string, 3> HS_Config::keys_recover_type = { // based on
"default-lastmode",
"normal-apps"
};
"default-lastmode",
"normal-apps"
};
+const std::string HS_Config::lastmode_json = "lastmode.json";
+const std::string HS_Config::key_appid = "appid";
+const std::string HS_Config::key_visibility = "visibility";
+std::string HS_Config::root_dir = "";
/**
* read configuration file to memory
/**
* read configuration file to memory
@@
-35,14
+39,14
@@
const std::array<std::string, 3> HS_Config::keys_recover_type = { // based on
*/
int HS_Config::readConfig(void)
{
*/
int HS_Config::readConfig(void)
{
-
auto root
dir = std::string(getenv("AFM_APP_INSTALL_DIR"));
- auto path = rootdir + "/etc/" + hs_conf_json;
+
root_
dir = std::string(getenv("AFM_APP_INSTALL_DIR"));
+ auto path = root
_
dir + "/etc/" + hs_conf_json;
if(readJsonFile(path.c_str(), &m_hs_conf) < 0) {
AFB_ERROR("read %s failed.", hs_conf_json.c_str());
return -1;
}
if(readJsonFile(path.c_str(), &m_hs_conf) < 0) {
AFB_ERROR("read %s failed.", hs_conf_json.c_str());
return -1;
}
- path = rootdir + "/etc/" + lastmode_json;
+ path = root
_
dir + "/etc/" + lastmode_json;
if(readJsonFile(path.c_str(), &m_lastmode) < 0) {
AFB_ERROR("read %s failed.", lastmode_json.c_str());
m_lastmode = nullptr;
if(readJsonFile(path.c_str(), &m_lastmode) < 0) {
AFB_ERROR("read %s failed.", lastmode_json.c_str());
m_lastmode = nullptr;