Skip to content

Commit 2679136

Browse files
iljukhaputdimkanovikov
authored andcommitted
Enhance BugSplat integration
- Append '-x32' to the version in the Windows build workflow for clarity. - Refactor application manager to return the database name through a function. - Add a test crash method for debugging purposes and connect it to a shortcut.
1 parent 12b6df5 commit 2679136

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

.github/workflows/build_starc_windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ jobs:
279279
password: "${{ secrets.BUGSPLAT_PASSWORD }}"
280280
database: "${{ secrets.BUGSPLAT_DATABASE }}"
281281
application: "starcapp-win"
282-
version: ${{env.BUGSPLAT_VERSION}}
282+
version: ${{env.BUGSPLAT_VERSION}}-x32
283283
files: "*.{pdb,exe,dll}"
284284
directory: "src/_build"
285285
node-version: "22"
@@ -293,7 +293,7 @@ jobs:
293293
password: "${{ secrets.BUGSPLAT_PASSWORD }}"
294294
database: "${{ secrets.BUGSPLAT_DATABASE }}"
295295
application: "starcapp-win"
296-
version: ${{env.BUGSPLAT_VERSION}}
296+
version: ${{env.BUGSPLAT_VERSION}}-x32
297297
files: "*.{pdb,dll}"
298298
directory: "src/_build/plugins"
299299
node-version: "22"
@@ -337,7 +337,7 @@ jobs:
337337
if: startsWith(github.ref, 'refs/tags/')
338338
shell: bash
339339
run: |
340-
curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=windows32" F "qt=5" -F "version=${{env.APP_VERSION}}" https://starc.app/api/app/updates/notify
340+
curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=windows32" -F "qt=5" -F "version=${{env.APP_VERSION}}" https://starc.app/api/app/updates/notify
341341
342342
build_windows_64_qt6:
343343
name: Build Windows 64 version with qt6

src/core/management_layer/application_manager.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
777793
void 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

Comments
 (0)