From aea75a2de0ecdb694ccca8418b00a2b601bc05c7 Mon Sep 17 00:00:00 2001 From: Max Risuhin Date: Sat, 8 Dec 2018 19:12:31 +0200 Subject: [PATCH] Prompt user explicitly to upload exact crash related files Signed-off-by: Max Risuhin --- desktop/main.cpp | 7 ------- desktop/reportApp/main.qml | 5 +++-- desktop/reportApp/reportpublisher.cpp | 18 ++++++++++++------ desktop_files/yarn.lock | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/desktop/main.cpp b/desktop/main.cpp index cafbf374e8..daef6d172e 100644 --- a/desktop/main.cpp +++ b/desktop/main.cpp @@ -46,12 +46,6 @@ QProcess *g_nodeJsServerProcess = nullptr; const int MAIN_WINDOW_WIDTH = 1024; const int MAIN_WINDOW_HEIGHT = 768; const QString CRASH_REPORT_EXECUTABLE = QStringLiteral("reportApp"); -const QString CRASH_REPORT_EXECUTABLE_RELATIVE_PATH = -#ifdef Q_OS_WIN - QStringLiteral(""); -#else - QStringLiteral("/../reportApp"); -#endif const char *ENABLE_LOG_FILE_ENV_VAR_NAME = "STATUS_LOG_FILE_ENABLED"; const char *LOG_FILE_PATH_ENV_VAR_NAME = "STATUS_LOG_PATH"; @@ -253,7 +247,6 @@ int main(int argc, char **argv) { killZombieJsServer(); } #else - appPath.append(CRASH_REPORT_EXECUTABLE_RELATIVE_PATH); dataStoragePath = ""; #endif diff --git a/desktop/reportApp/main.qml b/desktop/reportApp/main.qml index d246fa6b6e..77880b45ab 100644 --- a/desktop/reportApp/main.qml +++ b/desktop/reportApp/main.qml @@ -28,7 +28,7 @@ Rectangle { Text { Layout.alignment: Qt.AlignCenter Layout.topMargin: 20 - text: "Please report us crash log files to allow us fix the issue!" + text: "Please report us crash.dmp and Status executable files to allow us fix the issue!" font.bold: true font.pointSize: 20 } @@ -63,7 +63,8 @@ Rectangle { wrapMode: TextEdit.Wrap selectByMouse: true font.pointSize: 12 - text: "Log files directory:\n" + reportPublisher.resolveDataStoragePath() + textFormat: TextEdit.RichText + text: "
Please upload both crash.dmp and Status executable files from the report directory:
" + reportPublisher.resolveDataStoragePath() + "
" } Button { diff --git a/desktop/reportApp/reportpublisher.cpp b/desktop/reportApp/reportpublisher.cpp index 428eb6420a..8eff462610 100644 --- a/desktop/reportApp/reportpublisher.cpp +++ b/desktop/reportApp/reportpublisher.cpp @@ -36,17 +36,23 @@ void ReportPublisher::submit() { void ReportPublisher::restartAndQuit() { QString appPath = m_crashedExecutablePath; -#ifdef Q_OS_MACOS +#if defined(Q_OS_MACOS) || defined(Q_OS_LINUX) QFileInfo crashedExecutableFileInfo(m_crashedExecutablePath); QString fullPath = crashedExecutableFileInfo.dir().absolutePath(); + #ifdef Q_OS_MACOS const QString bundleExtension = QStringLiteral(".app"); + const QString cmdTemplate = QStringLiteral("open \"%1\""); + #else + const QString bundleExtension = QStringLiteral(".AppImage"); + const QString cmdTemplate = QStringLiteral("\"%1\""); + #endif if (fullPath.contains(bundleExtension)) { appPath = fullPath.left(fullPath.indexOf(bundleExtension) + bundleExtension.size()); } - QString cmd = QString("open %1").arg(appPath); + QString cmd = QString(cmdTemplate).arg(appPath); #else - QString cmd = appPath; + QString cmd = QString("\"%1\"").arg(appPath);; #endif QProcess::startDetached(cmd); @@ -61,8 +67,8 @@ void ReportPublisher::showDirectory() { if (!m_logFilesPrepared) { m_logFilesPrepared = prepareReportFiles(dataStoragePath); } - QDesktopServices::openUrl( - QUrl("file://" + dataStoragePath, QUrl::TolerantMode)); + + QDesktopServices::openUrl(QUrl::fromLocalFile(dataStoragePath)); } bool ReportPublisher::prepareReportFiles(QString reportDirPath) { @@ -101,5 +107,5 @@ QString ReportPublisher::resolveDataStoragePath() { if (!dir.exists()) { dir.mkpath("."); } - return dataStoragePath; + return dir.path(); } diff --git a/desktop_files/yarn.lock b/desktop_files/yarn.lock index 7eb63306f1..c2b68f2de8 100644 --- a/desktop_files/yarn.lock +++ b/desktop_files/yarn.lock @@ -4501,7 +4501,7 @@ glogg@^1.0.0: "google-breakpad@git+https://github.com/status-im/google-breakpad.git": version "1.0.0" - resolved "git+https://github.com/status-im/google-breakpad.git#9b6167b415d704c80a3303418a7c79d5ed0482ff" + resolved "git+https://github.com/status-im/google-breakpad.git#9fcfdc23010ce2b0742d276e2959ab13e7cf0dc7" got@^5.0.0, got@^5.2.0: version "5.7.1"