diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-07-23 00:38:03 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-03 11:39:02 -0500 |
| commit | ae118153fbedc0240ea183488834a32abe202839 (patch) | |
| tree | 2f291e14f8bbb21a09a7d3a27f9b20d7bdb9769d /src/organizercore.cpp | |
| parent | 9435202034cafb05ffc11aed48ff57536bce73f7 (diff) | |
more refactoring:
- moved splash stuff together
- moved stuff in the main loop into doOneRun()
Diffstat (limited to 'src/organizercore.cpp')
| -rw-r--r-- | src/organizercore.cpp | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index a9469e6e..0849d756 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -473,13 +473,43 @@ bool OrganizerCore::checkPathSymlinks() { return true; } -bool OrganizerCore::bootstrap() { - return createDirectory(m_Settings.paths().profiles()) && - createDirectory(m_Settings.paths().mods()) && - createDirectory(m_Settings.paths().downloads()) && - createDirectory(m_Settings.paths().overwrite()) && - createDirectory(QString::fromStdWString(crashDumpsPath())) && - checkPathSymlinks() && cycleDiagnostics(); +bool OrganizerCore::bootstrap() +{ + const auto dirs = { + m_Settings.paths().profiles(), + m_Settings.paths().mods(), + m_Settings.paths().downloads(), + m_Settings.paths().overwrite(), + QString::fromStdWString(crashDumpsPath()) + }; + + for (auto&& dir : dirs) { + if (!createDirectory(dir)) { + return false; + } + } + + if (!checkPathSymlinks()) { + return false; + } + + if (!cycleDiagnostics()) { + return false; + } + + // log if there are any dmp files + const auto hasCrashDumps = + !QDir(QString::fromStdWString(crashDumpsPath())) + .entryList({"*.dmp"}, QDir::Files) + .empty(); + + if (hasCrashDumps) { + log::debug( + "there are crash dumps in '{}'", + QString::fromStdWString(crashDumpsPath())); + } + + return true; } void OrganizerCore::createDefaultProfile() |
