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 // 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"); const QVector<QJsonObject> objects = requireIsArrayOf<QJsonObject>(obj, "properties");
QVector<QPair<QString, QString>> properties; QVector<QPair<QString, QString>> properties;
properties.reserve(objects.size()); properties.reserve(objects.size());
for (const auto& object : objects) for (const auto& object : objects) {
{
auto type = requireString(object, "type"); auto type = requireString(object, "type");
if (type == "override") if (type == "override") {
{
auto field1 = requireString(object, "target"); auto field1 = requireString(object, "target");
auto field2 = requireString(object, "value"); auto field2 = requireString(object, "value");
if (!field1.endsWith("Override") || !field2.startsWith("https")) if (!field1.endsWith("Override") || !field2.startsWith("https"))

View File

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

View File

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

View File

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