Signed-off-by: wohaopa <2411829240@qq.com>
This commit is contained in:
初夏同学 2023-10-28 20:34:12 +08:00
parent ab721409ab
commit caff26222c
No known key found for this signature in database
GPG Key ID: 83899E736B2B9DD7
4 changed files with 10 additions and 15 deletions

View File

@ -48,17 +48,15 @@ static std::shared_ptr<Index> parseIndexInternal(const QJsonObject& obj)
}
// Property
static std::shared_ptr<Property> parsePropertyInternal(const QJsonObject& obj){
static std::shared_ptr<Property> parsePropertyInternal(const QJsonObject& obj)
{
const QVector<QJsonObject> objects = requireIsArrayOf<QJsonObject>(obj, "properties");
QVector<QPair<QString, QString>> properties;
properties.reserve(objects.size());
for (const auto& object : objects)
{
for (const auto& object : objects) {
auto type = requireString(object, "type");
if (type == "override")
{
if (type == "override") {
auto field1 = requireString(object, "target");
auto field2 = requireString(object, "value");
if (!field1.endsWith("Override") || !field2.startsWith("https"))

View File

@ -36,17 +36,16 @@ void Property::merge(const std::shared_ptr<Property>& other)
m_properties = other->m_properties;
}
void Property::applyProperties() {
if (!isLoaded())
{
void Property::applyProperties()
{
if (!isLoaded()) {
load(Net::Mode::Online);
}
auto s = APPLICATION->settings();
for (auto& property : m_properties)
{
for (auto& property : m_properties) {
if (s->contains(property.first))
s->set(property.first,property.second);
s->set(property.first, property.second);
}
}
} // namespace Meta

View File

@ -179,8 +179,6 @@ QList<NetAction::Ptr> Library::getDownloads(const RuntimeContext& runtimeContext
else
#endif
return BuildConfig.LIBRARY_BASE + raw_storage;
}
if (m_repositoryURL.endsWith('/')) {

View File

@ -49,10 +49,10 @@
#include "Application.h"
#include "BuildConfig.h"
#include "meta/Index.h"
#include "net/PasteUpload.h"
#include "settings/SettingsObject.h"
#include "tools/BaseProfiler.h"
#include "meta/Index.h"
APIPage::APIPage(QWidget* parent) : QWidget(parent), ui(new Ui::APIPage)
{