summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp5
-rw-r--r--src/organizercore.cpp9
-rw-r--r--src/settings.cpp12
-rw-r--r--src/settings.h2
-rw-r--r--src/settingsdialog.ui9
-rw-r--r--src/shared/appconfig.inc1
6 files changed, 27 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp
index eed4dfd3..b4faf570 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -528,8 +528,6 @@ int runApplication(MOApplication &application, SingleInstance &instance,
int main(int argc, char *argv[])
{
- prevUnhandledExceptionFilter = SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
-
MOApplication application(argc, argv);
QStringList arguments = application.arguments();
@@ -586,6 +584,9 @@ int main(int argc, char *argv[])
}
application.setProperty("dataPath", dataPath);
+ // initialize dump collection only after "dataPath" since the crashes are stored under it
+ prevUnhandledExceptionFilter = SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
+
LogBuffer::init(100, QtDebugMsg, qApp->property("dataPath").toString() + "/logs/mo_interface.log");
QString splash = dataPath + "/splash.png";
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index bc0578b3..deb0b718 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -670,11 +670,10 @@ void OrganizerCore::setGlobalCrashDumpsType(int crashDumpsType) {
//static
std::wstring OrganizerCore::crashDumpsPath() {
- wchar_t appDataLocal[MAX_PATH]{ 0 };
- ::SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, appDataLocal);
- std::wstring dumpPath{ appDataLocal };
- dumpPath += L"\\modorganizer\\crashDumps";
- return dumpPath;
+ return (
+ qApp->property("dataPath").toString() + "/"
+ + QString::fromStdWString(AppConfig::dumpsDir())
+ ).toStdWString();
}
void OrganizerCore::setCurrentProfile(const QString &profileName)
diff --git a/src/settings.cpp b/src/settings.cpp
index 05a62591..b2fc8939 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -24,6 +24,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "settingsdialog.h"
#include "versioninfo.h"
#include "appconfig.h"
+#include "organizercore.h"
#include <utility.h>
#include <iplugin.h>
#include <iplugingame.h>
@@ -48,6 +49,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QDir>
#include <QStringList>
#include <QVariantMap>
+#include <QLabel>
#include <Qt> // for Qt::UserRole, etc
#include <QtDebug> // for qDebug, qWarning
@@ -755,10 +757,20 @@ Settings::DiagnosticsTab::DiagnosticsTab(Settings *m_parent, SettingsDialog &m_d
, m_logLevelBox(m_dialog.findChild<QComboBox *>("logLevelBox"))
, m_dumpsTypeBox(m_dialog.findChild<QComboBox *>("dumpsTypeBox"))
, m_dumpsMaxEdit(m_dialog.findChild<QSpinBox *>("dumpsMaxEdit"))
+ , m_diagnosticsExplainedLabel(m_dialog.findChild<QLabel *>("diagnosticsExplainedLabel"))
{
m_logLevelBox->setCurrentIndex(m_parent->logLevel());
m_dumpsTypeBox->setCurrentIndex(m_parent->crashDumpsType());
m_dumpsMaxEdit->setValue(m_parent->crashDumpsMax());
+ QString logsPath = qApp->property("dataPath").toString()
+ + "/" + QString::fromStdWString(AppConfig::logPath());
+ m_diagnosticsExplainedLabel->setText(
+ m_diagnosticsExplainedLabel->text()
+ .replace("LOGS_FULL_PATH", logsPath)
+ .replace("LOGS_DIR", QString::fromStdWString(AppConfig::logPath()))
+ .replace("DUMPS_FULL_PATH", QString::fromStdWString(OrganizerCore::crashDumpsPath()))
+ .replace("DUMPS_DIR", QString::fromStdWString(AppConfig::dumpsDir()))
+ );
}
void Settings::DiagnosticsTab::update()
diff --git a/src/settings.h b/src/settings.h
index 9ee29ba3..ae38223f 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -41,6 +41,7 @@ class QLineEdit;
class QSpinBox;
class QListWidget;
class QWidget;
+class QLabel;
struct ServerInfo;
@@ -414,6 +415,7 @@ private:
QComboBox *m_logLevelBox;
QComboBox *m_dumpsTypeBox;
QSpinBox *m_dumpsMaxEdit;
+ QLabel *m_diagnosticsExplainedLabel;
};
/** Display/store the configuration in the 'nexus' tab of the settings dialogue */
diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui
index 6d462cfa..7a902748 100644
--- a/src/settingsdialog.ui
+++ b/src/settingsdialog.ui
@@ -483,12 +483,13 @@ If you use pre-releases, never contact me directly by e-mail or via private mess
</layout>
</item>
<item row="4" column="0">
- <widget class="QLabel" name="label_29">
+ <widget class="QLabel" name="diagnosticsExplainedLabel">
<property name="text">
<string>
- Dumps are stored in &lt;a href=&quot;%LOCALAPPDATA%\modorganizer\crashDumps&quot;&gt;%LOCALAPPDATA%\modorganizer\crashDumps&lt;/a&gt;.
- Sending such dumps to the developers can help solve crashes caused by MO.
- It is recommended to compress the dumps before sending, especially on the larger settings.
+ Logs and crash dumps are stored under your current instance in the &lt;a href=&quot;LOGS_FULL_PATH&quot;&gt;LOGS_DIR&lt;/a&gt;
+ and &lt;a href=&quot;DUMPS_FULL_PATH&quot;&gt;DUMPS_DIR&lt;/a&gt; folders.
+ Sending logs and/or crash dumps to the developers can help investigate issues.
+ It is recommended to compress large log and dmp files before sending.
</string>
</property>
<property name="wordWrap">
diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc
index e98757d3..e572a32b 100644
--- a/src/shared/appconfig.inc
+++ b/src/shared/appconfig.inc
@@ -8,6 +8,7 @@ APPPARAM(std::wstring, stylesheetsPath, L"stylesheets")
APPPARAM(std::wstring, cachePath, L"webcache")
APPPARAM(std::wstring, tutorialsPath, L"tutorials")
APPPARAM(std::wstring, logPath, L"logs")
+APPPARAM(std::wstring, dumpsDir, L"crashDumps")
APPPARAM(std::wstring, profileTweakIni, L"profile_tweaks.ini")
APPPARAM(std::wstring, logFileName, L"ModOrganizer.log")
APPPARAM(std::wstring, iniFileName, L"ModOrganizer.ini")