summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-10-07 07:13:27 -0400
committerGitHub <noreply@github.com>2019-10-07 07:13:27 -0400
commit94b40b328b7e455ad4799b98c2b00cd5d96f86f3 (patch)
tree56421e4f0a153e23f40d4992debcd54fa4453149 /src
parent4dbd5412860deaf0d709be5dfac1b8772285d92d (diff)
parenta082c029b25dcbf0877f318092eae925d177f223 (diff)
Merge pull request #859 from isanae/usvfs-delay-parameter
Added spawn delay setting, not exposed
Diffstat (limited to 'src')
-rw-r--r--src/settings.cpp11
-rw-r--r--src/settings.h3
-rw-r--r--src/usvfsconnector.cpp11
3 files changed, 21 insertions, 4 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 15bc801a..5aeb82fe 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1997,3 +1997,14 @@ void DiagnosticsSettings::setCrashDumpsMax(int n)
{
set(m_Settings, "Settings", "crash_dumps_max", n);
}
+
+std::chrono::seconds DiagnosticsSettings::spawnDelay() const
+{
+ return std::chrono::seconds(
+ get<int>(m_Settings, "Settings", "spawn_delay", 0));
+}
+
+void DiagnosticsSettings::setSpawnDelay(std::chrono::seconds t)
+{
+ set(m_Settings, "Settings", "spawn_delay", t.count());
+}
diff --git a/src/settings.h b/src/settings.h
index 1556ba1e..d604823a 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -629,6 +629,9 @@ public:
int crashDumpsMax() const;
void setCrashDumpsMax(int n);
+ std::chrono::seconds spawnDelay() const;
+ void setSpawnDelay(std::chrono::seconds t);
+
private:
QSettings& m_Settings;
};
diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp
index 4315ed92..3ea811be 100644
--- a/src/usvfsconnector.cpp
+++ b/src/usvfsconnector.cpp
@@ -162,12 +162,15 @@ QString toString(CrashDumpsType t)
UsvfsConnector::UsvfsConnector()
{
+ const auto& s = Settings::instance();
+
USVFSParameters params;
- LogLevel level = toUsvfsLogLevel(Settings::instance().diagnostics().logLevel());
- CrashDumpsType dumpType = Settings::instance().diagnostics().crashDumpsType();
+ const LogLevel level = toUsvfsLogLevel(s.diagnostics().logLevel());
+ const CrashDumpsType dumpType = s.diagnostics().crashDumpsType();
+ const auto delay = s.diagnostics().spawnDelay();
std::string dumpPath = MOShared::ToString(OrganizerCore::crashDumpsPath(), true);
- USVFSInitParameters(&params, SHMID, false, level, dumpType, dumpPath.c_str());
+ USVFSInitParameters(&params, SHMID, false, level, dumpType, dumpPath.c_str(), delay);
InitLogging(false);
log::debug(
@@ -183,7 +186,7 @@ UsvfsConnector::UsvfsConnector()
CreateVFS(&params);
ClearExecutableBlacklist();
- for (auto exec : Settings::instance().executablesBlacklist().split(";")) {
+ for (auto exec : s.executablesBlacklist().split(";")) {
std::wstring buf = exec.toStdWString();
BlacklistExecutable(buf.data());
}