summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/organizercore.cpp6
-rw-r--r--src/organizercore.h2
-rw-r--r--src/usvfsconnector.cpp44
-rw-r--r--src/usvfsconnector.h2
4 files changed, 38 insertions, 16 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 335910da..df824c2b 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -484,10 +484,11 @@ void OrganizerCore::prepareVFS()
}
void OrganizerCore::updateVFSParams(
- log::Levels logLevel, CrashDumpsType crashDumpsType, QString executableBlacklist)
+ log::Levels logLevel, CrashDumpsType crashDumpsType,
+ std::chrono::seconds spawnDelay, QString executableBlacklist)
{
setGlobalCrashDumpsType(crashDumpsType);
- m_USVFS.updateParams(logLevel, crashDumpsType, executableBlacklist);
+ m_USVFS.updateParams(logLevel, crashDumpsType, spawnDelay, executableBlacklist);
}
void OrganizerCore::setLogLevel(log::Levels level)
@@ -497,6 +498,7 @@ void OrganizerCore::setLogLevel(log::Levels level)
updateVFSParams(
m_Settings.diagnostics().logLevel(),
m_Settings.diagnostics().crashDumpsType(),
+ m_Settings.diagnostics().spawnDelay(),
m_Settings.executablesBlacklist());
log::getDefault().setLevel(m_Settings.diagnostics().logLevel());
diff --git a/src/organizercore.h b/src/organizercore.h
index 5de550df..5b7dd87b 100644
--- a/src/organizercore.h
+++ b/src/organizercore.h
@@ -195,7 +195,7 @@ public:
void updateVFSParams(
MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType,
- QString executableBlacklist);
+ std::chrono::seconds spawnDelay, QString executableBlacklist);
void setLogLevel(MOBase::log::Levels level);
diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp
index 3ea811be..9a4fa742 100644
--- a/src/usvfsconnector.cpp
+++ b/src/usvfsconnector.cpp
@@ -162,15 +162,24 @@ QString toString(CrashDumpsType t)
UsvfsConnector::UsvfsConnector()
{
+ using namespace std::chrono;
+
const auto& s = Settings::instance();
- USVFSParameters params;
- const LogLevel level = toUsvfsLogLevel(s.diagnostics().logLevel());
+ const LogLevel logLevel = toUsvfsLogLevel(s.diagnostics().logLevel());
const CrashDumpsType dumpType = s.diagnostics().crashDumpsType();
- const auto delay = s.diagnostics().spawnDelay();
-
+ const auto delay = duration_cast<milliseconds>(s.diagnostics().spawnDelay());
std::string dumpPath = MOShared::ToString(OrganizerCore::crashDumpsPath(), true);
- USVFSInitParameters(&params, SHMID, false, level, dumpType, dumpPath.c_str(), delay);
+
+ usvfsParameters* params = usvfsCreateParameters();
+
+ usvfsSetInstanceName(params, SHMID);
+ usvfsSetDebugMode(params, false);
+ usvfsSetLogLevel(params, logLevel);
+ usvfsSetCrashDumpType(params, dumpType);
+ usvfsSetCrashDumpPath(params, dumpPath.c_str());
+ usvfsSetProcessDelay(params, delay.count());
+
InitLogging(false);
log::debug(
@@ -178,12 +187,13 @@ UsvfsConnector::UsvfsConnector()
" . instance: {}\n"
" . log: {}\n"
" . dump: {} ({})",
- params.instanceName,
- toString(params.logLevel),
- params.crashDumpsPath,
- toString(params.crashDumpsType));
+ SHMID,
+ toString(logLevel),
+ dumpPath.c_str(),
+ toString(dumpType));
- CreateVFS(&params);
+ usvfsCreateVFS(params);
+ usvfsFreeParameters(params);
ClearExecutableBlacklist();
for (auto exec : s.executablesBlacklist().split(";")) {
@@ -253,9 +263,19 @@ void UsvfsConnector::updateMapping(const MappingType &mapping)
void UsvfsConnector::updateParams(
MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType,
- QString executableBlacklist)
+ std::chrono::seconds spawnDelay, QString executableBlacklist)
{
- USVFSUpdateParams(toUsvfsLogLevel(logLevel), crashDumpsType);
+ using namespace std::chrono;
+
+ usvfsParameters* p = usvfsCreateParameters();
+
+ usvfsSetLogLevel(p, toUsvfsLogLevel(logLevel));
+ usvfsSetCrashDumpType(p, crashDumpsType);
+ usvfsSetProcessDelay(p, duration_cast<milliseconds>(spawnDelay).count());
+
+ usvfsUpdateParameters(p);
+ usvfsFreeParameters(p);
+
ClearExecutableBlacklist();
for (auto exec : executableBlacklist.split(";")) {
std::wstring buf = exec.toStdWString();
diff --git a/src/usvfsconnector.h b/src/usvfsconnector.h
index cd5d56b2..a4647eaf 100644
--- a/src/usvfsconnector.h
+++ b/src/usvfsconnector.h
@@ -88,7 +88,7 @@ public:
void updateParams(
MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType,
- QString executableBlacklist);
+ std::chrono::seconds spawnDelay, QString executableBlacklist);
void updateForcedLibraries(const QList<MOBase::ExecutableForcedLoadSetting> &forcedLibraries);