Set the path of the docs root.

This commit is contained in:
Luis Ángel San Martín 2016-06-24 21:09:41 +02:00
parent 10c261c77a
commit 3baeac6bac

View File

@ -82,6 +82,21 @@ void Startup::start() {
// Configure static file controller
QSettings* fileSettings=new QSettings(configFileName,QSettings::IniFormat,app);
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);
// Configure and start the TCP listener