Skip to content

Commit

Permalink
Refactor out the usage of the S3 struct
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Thaodan committed Aug 4, 2020
1 parent 43bc69e commit d8a173f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
17 changes: 0 additions & 17 deletions src/s3access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand All @@ -69,7 +54,6 @@ void S3Access::setSecret(QString const &secret)
{
if (m_secret != secret) {
m_secret = secret;
initialise();
emit secretChanged();
}
}
Expand All @@ -78,7 +62,6 @@ void S3Access::setBaseUrl(QString const &baseUrl)
{
if (m_baseUrl != baseUrl) {
m_baseUrl = baseUrl;
initialise();
emit baseUrlChanged();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/s3access.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public slots:
QString m_baseUrl;
QString m_bucket;

struct S3 *m_s3;
QNetworkAccessManager *m_manager;
};

Expand Down

0 comments on commit d8a173f

Please sign in to comment.