diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-24 11:22:24 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-24 11:22:24 -0500 |
| commit | 1b700785bb8b5a3891391f60b13c9fee4647b5dd (patch) | |
| tree | e9e9151684f2012ebf32ea6ffc5362586e61fbda /src | |
| parent | da0771853a27eb9e61d32c4326bd8f6af990b7b5 (diff) | |
don't log modules in winroot
dashes to dots
Diffstat (limited to 'src')
| -rw-r--r-- | src/env.cpp | 4 | ||||
| -rw-r--r-- | src/envmodule.cpp | 23 | ||||
| -rw-r--r-- | src/envmodule.h | 4 | ||||
| -rw-r--r-- | src/moapplication.cpp | 5 | ||||
| -rw-r--r-- | src/settings.cpp | 14 |
5 files changed, 41 insertions, 9 deletions
diff --git a/src/env.cpp b/src/env.cpp index edd8cd6b..76473dfb 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -345,7 +345,9 @@ void Environment::dump(const Settings& s) const log::debug("modules loaded in process:"); for (const auto& m : loadedModules()) { - log::debug(" . {}", m.toString()); + if (m.interesting()) { + log::debug(" . {}", m.toString()); + } } log::debug("displays:"); diff --git a/src/envmodule.cpp b/src/envmodule.cpp index 5f2a5f5a..81cbad8a 100644 --- a/src/envmodule.cpp +++ b/src/envmodule.cpp @@ -308,6 +308,29 @@ QDateTime Module::getTimestamp(const VS_FIXEDFILEINFO& fi) const QTime(utc.wHour, utc.wMinute, utc.wSecond, utc.wMilliseconds)); } +bool Module::interesting() const +{ + static const auto windir = []() -> QString { + try + { + return QDir::toNativeSeparators( + MOBase::getKnownFolder(FOLDERID_Windows).path()) + "\\"; + } + catch(...) + { + return "c:\\windows\\"; + } + }(); + + + if (m_path.startsWith(windir, Qt::CaseInsensitive)) { + return false; + } + + return true; +} + + QString Module::getMD5() const { static const std::set<QString> ignore = { diff --git a/src/envmodule.h b/src/envmodule.h index c2829b32..4b85d737 100644 --- a/src/envmodule.h +++ b/src/envmodule.h @@ -66,6 +66,10 @@ public: // QString timestampString() const; + // returns false for modules in the Windows root directory + // + bool interesting() const; + // returns a string with all the above information on one line // QString toString() const; diff --git a/src/moapplication.cpp b/src/moapplication.cpp index e7ac3926..88b5710f 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -254,7 +254,10 @@ int MOApplication::doOneRun(MOMultiProcess& multiProcess) sanity::checkEnvironment(env);
const auto moduleNotification = env.onModuleLoaded(qApp, [](auto&& m) {
- log::debug("loaded module {}", m.toString());
+ if (m.interesting()) {
+ log::debug("loaded module {}", m.toString());
+ }
+
sanity::checkIncompatibleModule(m);
});
diff --git a/src/settings.cpp b/src/settings.cpp index 436cd42b..ebb4fabe 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1971,14 +1971,14 @@ void NexusSettings::dump() const log::debug("nxmhandler settings:"); QSettings handler("HKEY_CURRENT_USER\\Software\\Classes\\nxm\\", QSettings::NativeFormat); - log::debug(" - primary: {}", handler.value("shell/open/command/Default").toString()); + log::debug(" . primary: {}", handler.value("shell/open/command/Default").toString()); const auto noregister = getOptional<bool>(s, "General", "noregister"); if (noregister) { - log::debug(" - noregister: {}", *noregister); + log::debug(" . noregister: {}", *noregister); } else { - log::debug(" - noregister: (not found)"); + log::debug(" . noregister: (not found)"); } ScopedReadArray sra(s, "handlers"); @@ -1988,10 +1988,10 @@ void NexusSettings::dump() const const auto executable = sra.get<QVariant>("executable"); const auto arguments = sra.get<QVariant>("arguments"); - log::debug(" - handler:"); - log::debug(" - games: {}", games.toString()); - log::debug(" - executable: {}", executable.toString()); - log::debug(" - arguments: {}", arguments.toString()); + log::debug(" . handler:"); + log::debug(" . games: {}", games.toString()); + log::debug(" . executable: {}", executable.toString()); + log::debug(" . arguments: {}", arguments.toString()); }); } |
