Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into validate_metadata

This commit is contained in:
Trial97
2024-07-21 02:24:30 +03:00
107 changed files with 1548 additions and 573 deletions

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Tayou <git@tayou.org>
* Copyright (C) 2024 Tayou <git@tayou.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -151,6 +151,10 @@ void ThemeCustomizationWidget::loadSettings()
int idx = 0;
for (auto& theme : themes) {
ui->widgetStyleComboBox->addItem(theme->name(), theme->id());
if (theme->tooltip() != "") {
int index = ui->widgetStyleComboBox->count() - 1;
ui->widgetStyleComboBox->setItemData(index, theme->tooltip(), Qt::ToolTipRole);
}
if (currentTheme == theme->id()) {
ui->widgetStyleComboBox->setCurrentIndex(idx);
}

View File

@@ -80,7 +80,7 @@ void VariableSizedImageObject::drawObject(QPainter* painter,
{
if (!format.hasProperty(ImageData)) {
QUrl image_url{ qvariant_cast<QString>(format.property(QTextFormat::ImageName)) };
if (m_fetching_images.contains(image_url))
if (m_fetching_images.contains(image_url) || image_url.isEmpty())
return;
auto meta = std::make_shared<ImageMetadata>();
@@ -140,6 +140,7 @@ void VariableSizedImageObject::loadImage(QTextDocument* doc, std::shared_ptr<Ima
QString("images/%1").arg(QString(QCryptographicHash::hash(meta->url.toEncoded(), QCryptographicHash::Algorithm::Sha1).toHex())));
auto job = new NetJob(QString("Load Image: %1").arg(meta->url.fileName()), APPLICATION->network());
job->setAskRetry(false);
job->addNetAction(Net::ApiDownload::makeCached(meta->url, entry));
auto full_entry_path = entry->getFullPath();