From d8a173fb843c6dc7a15bf86cac260eeab637c24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Mon, 3 Aug 2020 00:03:24 +0200 Subject: [PATCH] Refactor out the usage of the S3 struct The S3 struct is no longer used since all c-style s3 methods are no longer used. Remove all code that related to it. Removes the usage of: + s3_free() + s3_init() Contributes to #11. --- src/s3access.cpp | 17 ----------------- src/s3access.h | 1 - 2 files changed, 18 deletions(-) diff --git a/src/s3access.cpp b/src/s3access.cpp index 00b31b6..a8db6d9 100644 --- a/src/s3access.cpp +++ b/src/s3access.cpp @@ -34,33 +34,18 @@ S3Result::~S3Result() } S3Access::S3Access(QObject *parent) : QObject(parent) - , m_s3(nullptr) , m_manager(new QNetworkAccessManager(this)) { } S3Access::~S3Access() { - if (m_s3) { - s3_free(m_s3); - m_s3 = nullptr; - } -} - -void S3Access::initialise() -{ - if (m_s3) { - s3_free(m_s3); - m_s3 = nullptr; - } - m_s3 = s3_init(m_id.toLatin1().data(), m_baseUrl.toLatin1().data(), m_baseUrl.toLatin1().data()); } void S3Access::setId(QString const &id) { if (m_id != id) { m_id = id; - initialise(); emit idChanged(); } } @@ -69,7 +54,6 @@ void S3Access::setSecret(QString const &secret) { if (m_secret != secret) { m_secret = secret; - initialise(); emit secretChanged(); } } @@ -78,7 +62,6 @@ void S3Access::setBaseUrl(QString const &baseUrl) { if (m_baseUrl != baseUrl) { m_baseUrl = baseUrl; - initialise(); emit baseUrlChanged(); } } diff --git a/src/s3access.h b/src/s3access.h index d16d8a5..e0540a4 100644 --- a/src/s3access.h +++ b/src/s3access.h @@ -132,7 +132,6 @@ public slots: QString m_baseUrl; QString m_bucket; - struct S3 *m_s3; QNetworkAccessManager *m_manager; };