From 13df4883c897a1fc0386d1601762054dbecfde3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Tue, 24 Sep 2019 19:09:04 +0800 Subject: Reuse path --- controller.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'controller.cxx') diff --git a/controller.cxx b/controller.cxx index d007855..8447242 100644 --- a/controller.cxx +++ b/controller.cxx @@ -10,13 +10,11 @@ Controller::Controller(QObject* parent) : QObject{parent} { #ifdef ANDROID + QDir location{QStandardPaths::writableLocation + (QStandardPaths::AppDataLocation)}; + QString path{location.absolutePath() % "/ca-certificates.crt"}; QFile file{"assets:/certs/ca-certificates.crt"}; - file.copy(QDir{QStandardPaths::writableLocation - (QStandardPaths::AppDataLocation)}.absolutePath() - % "/ca-certificates.crt"); - auto path = QDir{QStandardPaths::writableLocation - (QStandardPaths::AppDataLocation)}.absolutePath() - % "/ca-certificates.crt"; + file.copy(path); auto client = new RTClient::Client{"https://darapsa.co.id/rt" , path.toLatin1().constData()}; #else -- cgit v1.2.3