summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-11-06 06:36:11 -0500
committerGitHub <noreply@github.com>2019-11-06 06:36:11 -0500
commit7b3c5dcbb3b5d520d166eb5b51f669968f57302e (patch)
treed9287fe49ab859d99f0efa712fdbb9c4a01c5b05 /src
parentaa582ab376a7973034bf1c91e354a3623889489e (diff)
parent33f5b59bee9fe5a1b3515737819ddfec4f596423 (diff)
Merge pull request #885 from isanae/usvfs-parameters-mutex
Crash dump path and toString()
Diffstat (limited to 'src')
-rw-r--r--src/organizercore.cpp5
-rw-r--r--src/organizercore.h3
-rw-r--r--src/usvfsconnector.cpp51
-rw-r--r--src/usvfsconnector.h6
4 files changed, 16 insertions, 49 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index df824c2b..5613e8ce 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -485,10 +485,12 @@ void OrganizerCore::prepareVFS()
void OrganizerCore::updateVFSParams(
log::Levels logLevel, CrashDumpsType crashDumpsType,
+ const QString& crashDumpsPath,
std::chrono::seconds spawnDelay, QString executableBlacklist)
{
setGlobalCrashDumpsType(crashDumpsType);
- m_USVFS.updateParams(logLevel, crashDumpsType, spawnDelay, executableBlacklist);
+ m_USVFS.updateParams(
+ logLevel, crashDumpsType, crashDumpsPath, spawnDelay, executableBlacklist);
}
void OrganizerCore::setLogLevel(log::Levels level)
@@ -498,6 +500,7 @@ void OrganizerCore::setLogLevel(log::Levels level)
updateVFSParams(
m_Settings.diagnostics().logLevel(),
m_Settings.diagnostics().crashDumpsType(),
+ QString::fromStdWString(crashDumpsPath()),
m_Settings.diagnostics().spawnDelay(),
m_Settings.executablesBlacklist());
diff --git a/src/organizercore.h b/src/organizercore.h
index 5b7dd87b..0d0a092c 100644
--- a/src/organizercore.h
+++ b/src/organizercore.h
@@ -195,7 +195,8 @@ public:
void updateVFSParams(
MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType,
- std::chrono::seconds spawnDelay, QString executableBlacklist);
+ const QString& crashDumpsPath, std::chrono::seconds spawnDelay,
+ QString executableBlacklist);
void setLogLevel(MOBase::log::Levels level);
diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp
index 9a4fa742..311c6dd3 100644
--- a/src/usvfsconnector.cpp
+++ b/src/usvfsconnector.cpp
@@ -118,48 +118,6 @@ CrashDumpsType crashDumpsType(int type)
}
}
-QString toString(LogLevel lv)
-{
- switch (lv)
- {
- case LogLevel::Debug:
- return "debug";
-
- case LogLevel::Info:
- return "info";
-
- case LogLevel::Warning:
- return "warning";
-
- case LogLevel::Error:
- return "error";
-
- default:
- return QString("%1").arg(static_cast<int>(lv));
- }
-}
-
-QString toString(CrashDumpsType t)
-{
- switch (t)
- {
- case CrashDumpsType::None:
- return "none";
-
- case CrashDumpsType::Mini:
- return "mini";
-
- case CrashDumpsType::Data:
- return "data";
-
- case CrashDumpsType::Full:
- return "full";
-
- default:
- return QString("%1").arg(static_cast<int>(t));
- }
-}
-
UsvfsConnector::UsvfsConnector()
{
using namespace std::chrono;
@@ -188,9 +146,9 @@ UsvfsConnector::UsvfsConnector()
" . log: {}\n"
" . dump: {} ({})",
SHMID,
- toString(logLevel),
+ usvfsLogLevelToString(logLevel),
dumpPath.c_str(),
- toString(dumpType));
+ usvfsCrashDumpTypeToString(dumpType));
usvfsCreateVFS(params);
usvfsFreeParameters(params);
@@ -263,14 +221,17 @@ void UsvfsConnector::updateMapping(const MappingType &mapping)
void UsvfsConnector::updateParams(
MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType,
- std::chrono::seconds spawnDelay, QString executableBlacklist)
+ const QString& crashDumpsPath, std::chrono::seconds spawnDelay,
+ QString executableBlacklist)
{
using namespace std::chrono;
usvfsParameters* p = usvfsCreateParameters();
+ usvfsSetDebugMode(p, FALSE);
usvfsSetLogLevel(p, toUsvfsLogLevel(logLevel));
usvfsSetCrashDumpType(p, crashDumpsType);
+ usvfsSetCrashDumpPath(p, crashDumpsPath.toStdString().c_str());
usvfsSetProcessDelay(p, duration_cast<milliseconds>(spawnDelay).count());
usvfsUpdateParameters(p);
diff --git a/src/usvfsconnector.h b/src/usvfsconnector.h
index a4647eaf..d0071678 100644
--- a/src/usvfsconnector.h
+++ b/src/usvfsconnector.h
@@ -88,9 +88,11 @@ public:
void updateParams(
MOBase::log::Levels logLevel, CrashDumpsType crashDumpsType,
- std::chrono::seconds spawnDelay, QString executableBlacklist);
+ const QString& crashDumpsPath, std::chrono::seconds spawnDelay,
+ QString executableBlacklist);
- void updateForcedLibraries(const QList<MOBase::ExecutableForcedLoadSetting> &forcedLibraries);
+ void updateForcedLibraries(
+ const QList<MOBase::ExecutableForcedLoadSetting> &forcedLibraries);
private: