History

redo cache switch

David Kelly committed 9 years ago

Commit 4a22fbc1 parent 64a443e10 files · +38 −49Browse files

Showing the changes to interface/src/Application.cpp (1 of 10 files). Show all

Unified · Split

interface/src/Application.cpp+8−2
@@ -480,6 +480,12 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 479 unmodified lines
480480 static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
481481 bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);
482482 bool previousSessionCrashed = CrashHandler::checkForResetSettings(runningMarkerExisted, suppressPrompt);
483+ // get dir to use for cache
484+ static const auto CACHE_SWITCH = "--cache";
485+ QString cacheDir = getCmdOption(argc, const_cast<const char**>(argv), CACHE_SWITCH);
486+ if (!cacheDir.isEmpty()) {
487+ qApp->setProperty(hifi::properties::APP_LOCAL_DATA_PATH, cacheDir);
488+ }
483489
484490 Setting::init();
485491
@@ -1218,8 +1224,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 732 unmodified lines
12181224 settingsTimer->stop();
12191225 // Delete it (this will trigger the thread destruction
12201226 settingsTimer->deleteLater();
1221− // Mark the settings thread as finished, so we know we can safely save in the main application
1222− // shutdown code
1227+ // Mark the settings thread as finished, so we know we can safely save in the main application
1228+ // shutdown code
12231229 _settingsGuard.trigger();
12241230 });
12251231