From ae85a76a31e376a1e56187ef479275d99b3afcde Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 4 Dec 2022 19:38:44 +0100 Subject: [PATCH] imageinfo: use nhttpd.conf as source for webif path --- src/gui/imageinfo.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 96060c094..9e941fcdd 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -601,7 +601,15 @@ void CImageInfo::hide() string CImageInfo::getYWebVersion() { + CConfigFile yConf('=', false); + yConf.loadConfig(CONFIGDIR "/nhttpd.conf"); + std::string ver = yConf.getString("WebsiteMain.directory", "n/a") + "/Y_Version.txt"; + CConfigFile yV('=', false); - yV.loadConfig(PRIVATE_HTTPDDIR "/Y_Version.txt"); - return yV.getString("version", "n/a"); + if (file_exists(ver.c_str())) + { + yV.loadConfig(ver); + return yV.getString("version", "n/a"); + } + return "n/a"; }