summaryrefslogtreecommitdiff
path: root/controller.cxx
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-26 15:41:10 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-26 15:41:10 +0800
commit9e238e0768530bab6a91742db806a0214e5dcbc3 (patch)
tree17ec21ff715dd7613c4c0f5559650b042c714529 /controller.cxx
parentcc9238a13bef9f31fb25e81d18934ec2cf10fd81 (diff)
Tidy up code
Diffstat (limited to 'controller.cxx')
-rw-r--r--controller.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/controller.cxx b/controller.cxx
index c4b8ca3..df10b20 100644
--- a/controller.cxx
+++ b/controller.cxx
@@ -10,16 +10,17 @@
Controller::Controller(QObject* parent) : QObject{parent}
{
#ifdef ANDROID
- QDir location{QStandardPaths::writableLocation
- (QStandardPaths::AppDataLocation)};
+ QDir location{QStandardPaths::writableLocation(QStandardPaths
+ ::AppDataLocation)};
QString path{location.absolutePath() % "/ca-certificates.crt"};
QFile file{"assets:/certs/ca-certificates.crt"};
file.copy(path);
+#endif
auto client = new RTClient::Client{"https://darapsa.co.id/rt"
- , path.toLatin1().constData()};
-#else
- auto client = new RTClient::Client{"https://darapsa.co.id/rt"};
+#ifdef ANDROID
+ , path.toLatin1().constData()
#endif
+ };
client->moveToThread(&thread);
connect(&thread, &QThread::finished, client, &QObject::deleteLater);