diff options
Diffstat (limited to 'launcher/Application.cpp')
-rw-r--r-- | launcher/Application.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 1659eb44..430a96af 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -376,7 +376,11 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) // init the logger { - static const QString logBase = BuildConfig.LAUNCHER_NAME + "-%0.log"; + static const QString logBase = "logs/"+BuildConfig.LAUNCHER_NAME + "-%0.log"; + QDir logDir = QDir(dataPath); + if(!logDir.exists("logs")) { + logDir.mkpath("logs"); //this can fail, but there is no need to throw an error *yet*, since it also triggers the error message below! + } auto moveFile = [](const QString &oldName, const QString &newName) { QFile::remove(newName); @@ -397,11 +401,11 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) QString( "The launcher couldn't create a log file - the data folder is not writable.\n" "\n" - "Make sure you have write permissions to the data folder.\n" + "Make sure you have write permissions to the logs folder.\n" "(%1)\n" "\n" "The launcher cannot continue until you fix this problem." - ).arg(dataPath) + ).arg(dataPath+"/logs") ); return; } @@ -1699,6 +1703,7 @@ bool Application::handleDataMigration(const QString& currentData, matcher->add(std::make_shared<SimplePrefixMatcher>(configFile)); matcher->add(std::make_shared<SimplePrefixMatcher>( BuildConfig.LAUNCHER_CONFIGFILE)); // it's possible that we already used that directory before + matcher->add(std::make_shared<SimplePrefixMatcher>("logs/")); matcher->add(std::make_shared<SimplePrefixMatcher>("accounts.json")); matcher->add(std::make_shared<SimplePrefixMatcher>("accounts/")); matcher->add(std::make_shared<SimplePrefixMatcher>("assets/")); |