diff options
author | Alexandr Galiuzov <agaliuzov@luxoft.com> | 2015-06-19 06:58:29 +0300 |
---|---|---|
committer | Alexandr Galiuzov <agaliuzov@luxoft.com> | 2015-06-19 06:58:29 +0300 |
commit | 239bb18424f4b231db3042a8ccf21c75cdaad79b (patch) | |
tree | 6955d70081c76c2104e6b13477aa6f647f90a80f /src/appMain/main.cc | |
parent | f89183680476461c32f97e92e7cf78bc62b9cae2 (diff) | |
parent | 5daa049e1be5432e30e77a0bf5a1851738462ce8 (diff) | |
download | sdl_core-239bb18424f4b231db3042a8ccf21c75cdaad79b.tar.gz |
Merge branch 'release/4.0.0' into develop
Diffstat (limited to 'src/appMain/main.cc')
-rw-r--r-- | src/appMain/main.cc | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/src/appMain/main.cc b/src/appMain/main.cc index c60be0b08f..f392061c1d 100644 --- a/src/appMain/main.cc +++ b/src/appMain/main.cc @@ -80,33 +80,12 @@ const std::string kLocalHostAddress = "127.0.0.1"; * @return true if success otherwise false. */ bool InitHmi() { - -struct stat sb; -if (stat("hmi_link", &sb) == -1) { - LOG4CXX_FATAL(logger_, "File with HMI link doesn't exist!"); - return false; -} - -std::ifstream file_str; -file_str.open("hmi_link"); - -if (!file_str.is_open()) { - LOG4CXX_FATAL(logger_, "File with HMI link was not opened!"); - return false; -} - -std::string hmi_link; -std::getline(file_str, hmi_link); - - -LOG4CXX_INFO(logger_, - "Input string:" << hmi_link << " length = " << hmi_link.size()); -file_str.close(); - -if (stat(hmi_link.c_str(), &sb) == -1) { - LOG4CXX_FATAL(logger_, "HMI index.html doesn't exist!"); - return false; -} + std::string hmi_link = profile::Profile::instance()->link_to_web_hmi(); + struct stat sb; + if (stat(hmi_link.c_str(), &sb) == -1) { + LOG4CXX_FATAL(logger_, "HMI index.html doesn't exist!"); + return false; + } return utils::System(kBrowser, kBrowserName).Add(kBrowserParams).Add(hmi_link) .Execute(); } @@ -204,12 +183,10 @@ int32_t main(int32_t argc, char** argv) { #ifndef NO_HMI if (!InitHmi()) { - LOG4CXX_FATAL(logger_, "Failed to init HMI"); - main_namespace::LifeCycle::instance()->StopComponents(); - DEINIT_LOGGER(); - exit(EXIT_FAILURE); + LOG4CXX_INFO(logger_, "InitHmi successful"); + } else { + LOG4CXX_WARN(logger_, "Failed to init HMI"); } - LOG4CXX_INFO(logger_, "InitHmi successful"); #endif // #ifndef NO_HMI } } |