Skip to content

Commit 4c38484

Browse files
committed
Qt: Failed to retrieve update change list is not fatal
1 parent f248c1c commit 4c38484

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/duckstation-qt/autoupdaterdialog.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ void AutoUpdaterDialog::queueGetChanges()
454454

455455
void AutoUpdaterDialog::getChangesComplete(s32 status_code, const Error& error, std::vector<u8> response)
456456
{
457+
std::string_view error_message;
458+
457459
if (status_code == HTTPDownloader::HTTP_STATUS_OK)
458460
{
459461
QJsonParseError parse_error;
@@ -509,16 +511,23 @@ void AutoUpdaterDialog::getChangesComplete(s32 status_code, const Error& error,
509511
}
510512

511513
m_ui.updateNotes->setText(changes_html);
514+
return;
512515
}
513516
else
514517
{
515-
reportError("Change list JSON is not an object");
518+
error_message = "Change list JSON is not an object";
516519
}
517520
}
518521
else
519522
{
520-
reportError(fmt::format("Failed to download change list: {}", error.GetDescription()));
523+
error_message = error.GetDescription();
521524
}
525+
526+
m_ui.updateNotes->setText(QString::fromStdString(
527+
fmt::format("<h2>Failed to download change list</h2><p>The error was:<pre>{}</pre></p><p>You may be able to "
528+
"install this update anyway. If the download installation fails, you can download the update "
529+
"from:</p><p><a href=\"" DOWNLOAD_PAGE_URL "\">" DOWNLOAD_PAGE_URL "</a></p>",
530+
error_message, UPDATER_RELEASE_CHANNEL, UPDATER_RELEASE_CHANNEL)));
522531
}
523532

524533
void AutoUpdaterDialog::downloadUpdateClicked()

src/duckstation-qt/autoupdaterdialog.ui

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@
114114
</layout>
115115
</item>
116116
<item>
117-
<widget class="QTextBrowser" name="updateNotes"/>
117+
<widget class="QTextBrowser" name="updateNotes">
118+
<property name="openExternalLinks">
119+
<bool>true</bool>
120+
</property>
121+
</widget>
118122
</item>
119123
<item>
120124
<layout class="QHBoxLayout" name="actionButtons">

0 commit comments

Comments
 (0)