diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-05 08:53:31 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-05 08:53:31 -0400 |
| commit | 76df854483c40cb7610d79c5540a5e67f554d840 (patch) | |
| tree | 14670d7ce21598f7570de952ad104b2f3576010a /src/organizercore.cpp | |
| parent | 605b669bed0344fa6539a471a040d3ceeb24771c (diff) | |
only log a warning for symlinks instead of exiting MO
added logs: when dmp files are present, for portable instances, and the ini path
clear the log widget when switching instances
Diffstat (limited to 'src/organizercore.cpp')
| -rw-r--r-- | src/organizercore.cpp | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index a4a89c99..335910da 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -443,16 +443,20 @@ bool OrganizerCore::createDirectory(const QString &path) { } bool OrganizerCore::checkPathSymlinks() { - bool hasSymlink = (QFileInfo(m_Settings.paths().profiles()).isSymLink() || + const bool hasSymlink = ( + QFileInfo(m_Settings.paths().profiles()).isSymLink() || QFileInfo(m_Settings.paths().mods()).isSymLink() || QFileInfo(m_Settings.paths().overwrite()).isSymLink()); + if (hasSymlink) { - QMessageBox::critical(nullptr, QObject::tr("Error"), - QObject::tr("One of the configured MO2 directories (profiles, mods, or overwrite) " - "is on a path containing a symbolic (or other) link. This is incompatible " - "with MO2's VFS system.")); + log::warn("{}", QObject::tr( + "One of the configured MO2 directories (profiles, mods, or overwrite) " + "is on a path containing a symbolic (or other) link. This is likely to " + "be incompatible with MO2's virtual filesystem.")); + return false; } + return true; } @@ -498,18 +502,29 @@ void OrganizerCore::setLogLevel(log::Levels level) log::getDefault().setLevel(m_Settings.diagnostics().logLevel()); } -bool OrganizerCore::cycleDiagnostics() { - if (int maxDumps = settings().diagnostics().crashDumpsMax()) - removeOldFiles(QString::fromStdWString(crashDumpsPath()), "*.dmp", maxDumps, QDir::Time|QDir::Reversed); +bool OrganizerCore::cycleDiagnostics() +{ + const auto maxDumps = settings().diagnostics().crashDumpsMax(); + const auto path = QString::fromStdWString(crashDumpsPath()); + + if (maxDumps > 0) { + removeOldFiles(path, "*.dmp", maxDumps, QDir::Time|QDir::Reversed); + } + + // log if there are any files left + const auto files = QDir(path).entryList({"*.dmp"}, QDir::Files); + if (!files.isEmpty()) { + log::debug("there are crash dumps in '{}'", path); + } + return true; } -//static -void OrganizerCore::setGlobalCrashDumpsType(CrashDumpsType type) { +void OrganizerCore::setGlobalCrashDumpsType(CrashDumpsType type) +{ m_globalCrashDumpsType = type; } -//static std::wstring OrganizerCore::crashDumpsPath() { return ( qApp->property("dataPath").toString() + "/" |
