Upgraded pack changelog

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-07-16 01:59:08 +03:00
parent 37fb52aada
commit a3ffa64550
2 changed files with 27 additions and 1 deletions

View File

@ -3,6 +3,9 @@
// SPDX-License-Identifier: GPL-3.0-only
#include "ManagedPackPage.h"
#include <QDesktopServices>
#include <QUrl>
#include <QUrlQuery>
#include "ui_ManagedPackPage.h"
#include <QListView>
@ -103,6 +106,19 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi
// Pretend we're opening the page again
openedImpl();
});
connect(ui->changelogTextBrowser, &QTextBrowser::anchorClicked, this, [](const QUrl url) {
if (url.scheme().isEmpty()) {
auto querry =
QUrlQuery(url.query()).queryItemValue("remoteUrl", QUrl::FullyDecoded); // curseforge workaround for linkout?remoteUrl=
auto decoded = QUrl::fromPercentEncoding(querry.toUtf8());
auto newUrl = QUrl(decoded);
if (newUrl.isValid() && (newUrl.scheme() == "http" || newUrl.scheme() == "https"))
QDesktopServices ::openUrl(newUrl);
return;
}
QDesktopServices::openUrl(url);
});
}
ManagedPackPage::~ManagedPackPage()