summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2020-09-30 18:21:31 +0200
committerRuben Pollan <meskio@sindominio.net>2020-09-30 18:31:05 +0200
commit562af9100a9250f765fbae994775e326ce295fff (patch)
tree472a073aac9d044f6f420b9abd584ae58df9bc49 /gui
parent89b148d143870161909eb6170d4fc1840277aa94 (diff)
[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.
Diffstat (limited to 'gui')
-rw-r--r--gui/main.cpp5
1 files changed, 3 insertions, 2 deletions
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 */