mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
switch to change ktx_cache directory (only)
This commit is contained in:
parent
63279f4525
commit
04160f2ca1
3 changed files with 23 additions and 4 deletions
|
@ -71,15 +71,17 @@ int main(int argc, const char* argv[]) {
|
||||||
QCommandLineOption runServerOption("runServer", "Whether to run the server");
|
QCommandLineOption runServerOption("runServer", "Whether to run the server");
|
||||||
QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath");
|
QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath");
|
||||||
QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run");
|
QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run");
|
||||||
|
QCommandLineOption overrideAppLocalDataPathOption("cache", "Override cache directory", "value");
|
||||||
parser.addOption(urlOption);
|
parser.addOption(urlOption);
|
||||||
parser.addOption(noUpdaterOption);
|
parser.addOption(noUpdaterOption);
|
||||||
parser.addOption(checkMinSpecOption);
|
parser.addOption(checkMinSpecOption);
|
||||||
parser.addOption(runServerOption);
|
parser.addOption(runServerOption);
|
||||||
parser.addOption(serverContentPathOption);
|
parser.addOption(serverContentPathOption);
|
||||||
|
parser.addOption(overrideAppLocalDataPathOption);
|
||||||
parser.addOption(allowMultipleInstancesOption);
|
parser.addOption(allowMultipleInstancesOption);
|
||||||
parser.parse(arguments);
|
parser.parse(arguments);
|
||||||
|
|
||||||
|
|
||||||
const QString& applicationName = getInterfaceSharedMemoryName();
|
const QString& applicationName = getInterfaceSharedMemoryName();
|
||||||
bool instanceMightBeRunning = true;
|
bool instanceMightBeRunning = true;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
@ -96,6 +98,10 @@ int main(int argc, const char* argv[]) {
|
||||||
if (allowMultipleInstances) {
|
if (allowMultipleInstances) {
|
||||||
instanceMightBeRunning = false;
|
instanceMightBeRunning = false;
|
||||||
}
|
}
|
||||||
|
if (parser.isSet(overrideAppLocalDataPathOption)) {
|
||||||
|
QString appLocalDataPath = parser.value(overrideAppLocalDataPathOption);
|
||||||
|
PathUtils::getAppLocalDataPath(appLocalDataPath);
|
||||||
|
}
|
||||||
|
|
||||||
if (instanceMightBeRunning) {
|
if (instanceMightBeRunning) {
|
||||||
// Try to connect and send message to existing interface instance
|
// Try to connect and send message to existing interface instance
|
||||||
|
@ -179,7 +185,7 @@ int main(int argc, const char* argv[]) {
|
||||||
QString openvrDllPath = appPath + "/plugins/openvr.dll";
|
QString openvrDllPath = appPath + "/plugins/openvr.dll";
|
||||||
HMODULE openvrDll;
|
HMODULE openvrDll;
|
||||||
CHECKMINSPECPROC checkMinSpecPtr;
|
CHECKMINSPECPROC checkMinSpecPtr;
|
||||||
if ((openvrDll = LoadLibrary(openvrDllPath.toLocal8Bit().data())) &&
|
if ((openvrDll = LoadLibrary(openvrDllPath.toLocal8Bit().data())) &&
|
||||||
(checkMinSpecPtr = (CHECKMINSPECPROC)GetProcAddress(openvrDll, "CheckMinSpec"))) {
|
(checkMinSpecPtr = (CHECKMINSPECPROC)GetProcAddress(openvrDll, "CheckMinSpec"))) {
|
||||||
if (!checkMinSpecPtr()) {
|
if (!checkMinSpecPtr()) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -34,7 +34,20 @@ QString PathUtils::getAppDataPath() {
|
||||||
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/";
|
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PathUtils::getAppLocalDataPath() {
|
QString PathUtils::getAppLocalDataPath(const QString& overridePath) {
|
||||||
|
static QString overriddenPath = "";
|
||||||
|
|
||||||
|
// set the overridden path if one was passed in
|
||||||
|
if (!overridePath.isEmpty()) {
|
||||||
|
overriddenPath = overridePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return overridden path if there is one
|
||||||
|
if (!overriddenPath.isEmpty()) {
|
||||||
|
return overriddenPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// otherwise return the standard path
|
||||||
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/";
|
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public:
|
||||||
static const QString& resourcesPath();
|
static const QString& resourcesPath();
|
||||||
|
|
||||||
static QString getAppDataPath();
|
static QString getAppDataPath();
|
||||||
static QString getAppLocalDataPath();
|
static QString getAppLocalDataPath(const QString& overrideDataPath = "");
|
||||||
|
|
||||||
static QString getAppDataFilePath(const QString& filename);
|
static QString getAppDataFilePath(const QString& filename);
|
||||||
static QString getAppLocalDataFilePath(const QString& filename);
|
static QString getAppLocalDataFilePath(const QString& filename);
|
||||||
|
|
Loading…
Reference in a new issue