diff options
author | saturneric <[email protected]> | 2024-01-12 06:02:37 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-12 06:02:37 +0000 |
commit | bf538056b24a68b8fd235b1c50991ee8eb46a776 (patch) | |
tree | e1bab54095b80df62b321fb5bd69453f9f951b05 /src/core/model/GpgData.cpp | |
parent | feat: improve api and ui of keys import and export (diff) | |
download | GpgFrontend-bf538056b24a68b8fd235b1c50991ee8eb46a776.tar.gz GpgFrontend-bf538056b24a68b8fd235b1c50991ee8eb46a776.zip |
refactor: use QString instead of std::string and improve threading system
Diffstat (limited to 'src/core/model/GpgData.cpp')
-rw-r--r-- | src/core/model/GpgData.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/core/model/GpgData.cpp b/src/core/model/GpgData.cpp index 15b01595..e3d5e666 100644 --- a/src/core/model/GpgData.cpp +++ b/src/core/model/GpgData.cpp @@ -127,29 +127,6 @@ GpgData::~GpgData() { } } -auto GpgData::Read2Buffer() -> ByteArrayPtr { - gpgme_off_t ret = gpgme_data_seek(*this, 0, SEEK_SET); - ByteArrayPtr out_buffer = std::make_unique<std::string>(); - - if (ret != 0) { - GpgError const err = gpgme_err_code_from_errno(errno); - assert(gpgme_err_code(err) == GPG_ERR_NO_ERROR); - } else { - std::array<std::byte, kBufferSize + 2> buf; - - while ((ret = gpgme_data_read(*this, buf.data(), kBufferSize)) > 0) { - const size_t size = out_buffer->size(); - out_buffer->resize(static_cast<int>(size + ret)); - memcpy(out_buffer->data() + size, buf.data(), ret); - } - if (ret < 0) { - GpgError const err = gpgme_err_code_from_errno(errno); - assert(gpgme_err_code(err) == GPG_ERR_NO_ERROR); - } - } - return out_buffer; -} - auto GpgData::Read2GFBuffer() -> GFBuffer { gpgme_off_t ret = gpgme_data_seek(*this, 0, SEEK_SET); GFBuffer out_buffer; |