Fix compiling on windows and other mistakes
This commit is contained in:
parent
586618f1ac
commit
552da59007
|
@ -15,5 +15,5 @@ add_custom_command(
|
|||
target_sources(installer PRIVATE resources/resources.cpp resources/resources.h)
|
||||
|
||||
target_link_libraries(installer PRIVATE wx::base wx::core wx::net wx::xrc)
|
||||
include_directories(lib/wx/include)
|
||||
include_directories(lib/json/include)
|
||||
include_directories(../lib/wx/include)
|
||||
include_directories(../lib/json/include)
|
||||
|
|
|
@ -19,7 +19,7 @@ static LoaderLibrary make_loader_library(const nlohmann::json &json) {
|
|||
if (name.IsEmpty() || url.IsEmpty() || sha1.IsEmpty() || size < 0)
|
||||
return {};
|
||||
|
||||
return {.valid = true, .name = std::move(name), .url = std::move(url), .sha1 = std::move(sha1), .size = size};
|
||||
return {true, std::move(name), std::move(url), std::move(sha1), size};
|
||||
}
|
||||
|
||||
static LoaderVersion make_loader_version(const nlohmann::json &json) {
|
||||
|
@ -50,8 +50,7 @@ static LoaderVersion make_loader_version(const nlohmann::json &json) {
|
|||
if (version.IsEmpty() || !release_date.IsValid())
|
||||
return {};
|
||||
|
||||
return {
|
||||
.valid = true, .version = std::move(version), .release_date = release_date, .libraries = std::move(libraries)};
|
||||
return {true, std::move(version), release_date, std::move(libraries)};
|
||||
}
|
||||
|
||||
void get_loader_version(wxEvtHandler *handler, const wxString &version,
|
||||
|
@ -66,7 +65,7 @@ void get_loader_version(wxEvtHandler *handler, const wxString &version,
|
|||
|
||||
request.SetHeader("User-Agent", info::USER_AGENT);
|
||||
|
||||
handler->Bind(wxEVT_WEBREQUEST_STATE, [callback = std::move(callback)](wxWebRequestEvent &event) mutable {
|
||||
handler->Bind(wxEVT_WEBREQUEST_STATE, [callback = std::move(callback)](const wxWebRequestEvent &event) mutable {
|
||||
if (event.GetState() == wxWebRequest::State_Completed) {
|
||||
const nlohmann::json json = nlohmann::json::parse(event.GetResponse().AsString().utf8_string());
|
||||
|
||||
|
@ -102,7 +101,7 @@ void get_loader_versions(wxEvtHandler *handler,
|
|||
|
||||
request.SetHeader("User-Agent", info::USER_AGENT);
|
||||
|
||||
handler->Bind(wxEVT_WEBREQUEST_STATE, [callback = std::move(callback)](wxWebRequestEvent &event) mutable {
|
||||
handler->Bind(wxEVT_WEBREQUEST_STATE, [callback = std::move(callback)](const wxWebRequestEvent &event) mutable {
|
||||
if (event.GetState() == wxWebRequest::State_Completed) {
|
||||
const nlohmann::json json = nlohmann::json::parse(event.GetResponse().AsString().utf8_string());
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <optional>
|
||||
#include <wx/datetime.h>
|
||||
#include <wx/event.h>
|
||||
#include <cstdint>
|
||||
|
||||
struct LoaderLibrary {
|
||||
bool valid;
|
||||
|
|
Loading…
Reference in a new issue