From 562af9100a9250f765fbae994775e326ce295fff Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Wed, 30 Sep 2020 18:21:31 +0200 Subject: [feat] pass the raw byte json to the backend The C++ library does interpret anything as strings, we want to keep the orignal json types. --- gui/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gui/main.cpp') diff --git a/gui/main.cpp b/gui/main.cpp index 11c60a4..a177e60 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -62,7 +62,8 @@ int main(int argc, char **argv) { QFile providerJson (":/providers.json"); providerJson.open(QIODevice::ReadOnly | QIODevice::Text); QJsonModel *providers = new QJsonModel; - providers->loadJson(providerJson.readAll()); + QByteArray providerJsonBytes = providerJson.readAll(); + providers->loadJson(providerJsonBytes); QJsonValue defaultProvider = providers->json().object().value("default"); QJsonValue providersInfo = providers->json().object().value("providers"); QString appName = getAppName(providersInfo, defaultProvider.toString()); @@ -199,7 +200,7 @@ int main(int argc, char **argv) { /* let the Go side initialize its internal state */ InitializeBitmaskContext( toGoStr(defaultProvider.toString()), - (char*)QProvidersJSON.toUtf8().data(), strlen(QProvidersJSON.toUtf8().data()), + (char*)providerJsonBytes.data(), providerJsonBytes.length(), obfs4, disAutostart, toGoStr(startVPN)); /* if requested, enable web api for controlling the VPN */ -- cgit v1.2.3