@@ -129,7 +129,10 @@ QString bugsplatAppName()
129129 return appName;
130130}
131131
132- const QString kBugsplatDatabaseName (" starc-desktop" );
132+ QString bugsplatDatabaseName ()
133+ {
134+ return QString (" starc-desktop" );
135+ }
133136
134137} // namespace
135138
@@ -154,6 +157,11 @@ class ApplicationManager::Implementation
154157 */
155158 void sendCrashInfo ();
156159
160+ /* *
161+ * @brief Вызвать тестовый краш для проверки системы краш-репортов
162+ */
163+ void testCrash ();
164+
157165 /* *
158166 * @brief Загрузить недостающие шрифты
159167 */
@@ -619,7 +627,7 @@ void ApplicationManager::Implementation::sendCrashInfo()
619627 [this , database = std::move (database), reportsToSend, dialog] {
620628 for (auto & report : reportsToSend) {
621629 const QUrl url (QStringLiteral (" https://%1.bugsplat.com/post/bp/crash/crashpad.php" )
622- .arg (kBugsplatDatabaseName ));
630+ .arg (bugsplatDatabaseName () ));
623631
624632 //
625633 // Проверим наличие файла дампа
@@ -656,6 +664,9 @@ void ApplicationManager::Implementation::sendCrashInfo()
656664 appVersion += " -qt5" ;
657665#elif QT_VERSION_MAJOR == 6
658666 appVersion += " -qt6" ;
667+ #endif
668+ #if defined(Q_OS_WINDOWS) && defined(_WIN32) && !defined(_WIN64)
669+ appVersion += " -x32" ;
659670#endif
660671 loader->addRequestAttribute (" version" , appVersion);
661672 loader->addRequestAttribute (" qt" , QString (" Qt" ) + QT_VERSION_STR);
@@ -774,6 +785,11 @@ void ApplicationManager::Implementation::sendCrashInfo()
774785 dialog->showDialog ();
775786}
776787
788+ void ApplicationManager::Implementation::testCrash ()
789+ {
790+ *(volatile int *)0 = 0 ;
791+ }
792+
777793void ApplicationManager::Implementation::loadMissedFonts ()
778794{
779795 //
@@ -1375,7 +1391,7 @@ bool ApplicationManager::Implementation::initializeCrashpad()
13751391 base::FilePath reportsDir (CrashpadPaths::getPlatformString (crashpadPaths.getReportsPath ()));
13761392 base::FilePath metricsDir (CrashpadPaths::getPlatformString (crashpadPaths.getMetricsPath ()));
13771393
1378- const QString dbName = kBugsplatDatabaseName ;
1394+ const QString dbName = bugsplatDatabaseName () ;
13791395 const QString appName = bugsplatAppName ();
13801396 QString appVersion = QApplication::applicationVersion ();
13811397#if QT_VERSION_MAJOR == 5
@@ -2925,7 +2941,7 @@ void ApplicationManager::initConnections()
29252941 QShortcut* testCrashShortcut = new QShortcut (QKeySequence (" Ctrl+Shift+C" ), d->applicationView );
29262942#endif
29272943 testCrashShortcut->setContext (Qt::ApplicationShortcut);
2928- connect (testCrashShortcut, &QShortcut::activated, this , [] { *( volatile int *) 0 = 0 ; });
2944+ connect (testCrashShortcut, &QShortcut::activated, this , [this ] { d-> testCrash () ; });
29292945
29302946 //
29312947 // Представление приложения
0 commit comments