From 25a32314a25e42849e47a269e72f8473725f3f01 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Sun, 23 Oct 2022 18:35:35 +0200 Subject: [PATCH] Server: Don't overwrite template and docroot path --- YACReaderLibrary/server/yacreader_http_server.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/YACReaderLibrary/server/yacreader_http_server.cpp b/YACReaderLibrary/server/yacreader_http_server.cpp index 1f57b9e7..40ba799d 100644 --- a/YACReaderLibrary/server/yacreader_http_server.cpp +++ b/YACReaderLibrary/server/yacreader_http_server.cpp @@ -53,8 +53,8 @@ void YACReaderHttpServer::start(quint16 port) #else templatePath = QFileInfo(QCoreApplication::applicationDirPath(), baseTemplatePath).absoluteFilePath(); #endif - - templateSettings->setValue("path", templatePath); + if (!templateSettings->contains("path")) + templateSettings->setValue("path", templatePath); Static::templateLoader = new TemplateCache(templateSettings, app); @@ -84,7 +84,8 @@ void YACReaderHttpServer::start(quint16 port) docroot = QFileInfo(QCoreApplication::applicationDirPath(), basedocroot).absoluteFilePath(); #endif - fileSettings->setValue("path", docroot); + if (!fileSettings->contains("path")) + fileSettings->setValue("path", docroot); Static::staticFileController = new StaticFileController(fileSettings, app);