mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
Set the path of the docs root.
This commit is contained in:
parent
10c261c77a
commit
3baeac6bac
@ -82,6 +82,21 @@ void Startup::start() {
|
|||||||
// Configure static file controller
|
// Configure static file controller
|
||||||
QSettings* fileSettings=new QSettings(configFileName,QSettings::IniFormat,app);
|
QSettings* fileSettings=new QSettings(configFileName,QSettings::IniFormat,app);
|
||||||
fileSettings->beginGroup("docroot");
|
fileSettings->beginGroup("docroot");
|
||||||
|
|
||||||
|
QString basedocroot = "./server/docroot";
|
||||||
|
QString docroot;
|
||||||
|
|
||||||
|
#if defined Q_OS_UNIX && ! defined Q_OS_MAC
|
||||||
|
QFileInfo configFile(QString(DATADIR)+"/yacreader");
|
||||||
|
docroot=QFileInfo(QString(DATADIR)+"/yacreader",basedocroot).absoluteFilePath();
|
||||||
|
#else
|
||||||
|
QFileInfo configFile(QCoreApplication::applicationDirPath());
|
||||||
|
docroot=QFileInfo(QCoreApplication::applicationDirPath(),basedocroot).absoluteFilePath();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(fileSettings->value("path").isNull())
|
||||||
|
fileSettings->setValue("path",docroot);
|
||||||
|
|
||||||
Static::staticFileController=new StaticFileController(fileSettings,app);
|
Static::staticFileController=new StaticFileController(fileSettings,app);
|
||||||
|
|
||||||
// Configure and start the TCP listener
|
// Configure and start the TCP listener
|
||||||
|
Loading…
x
Reference in New Issue
Block a user