diff options
author | saturneric <[email protected]> | 2023-03-31 19:14:23 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-03-31 19:14:23 +0000 |
commit | d15c83a1697d3798ed19261d2be617099d33a4ad (patch) | |
tree | d449ca25b8b7d2eb43e6dfe6187113d96876222c /src/core/function/ArchiveFileOperator.cpp | |
parent | fix: solve ui issues in network settings (diff) | |
download | GpgFrontend-d15c83a1697d3798ed19261d2be617099d33a4ad.tar.gz GpgFrontend-d15c83a1697d3798ed19261d2be617099d33a4ad.zip |
fix: solve codacy issues
Diffstat (limited to 'src/core/function/ArchiveFileOperator.cpp')
-rw-r--r-- | src/core/function/ArchiveFileOperator.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/core/function/ArchiveFileOperator.cpp b/src/core/function/ArchiveFileOperator.cpp index 04c9326f..8aad0500 100644 --- a/src/core/function/ArchiveFileOperator.cpp +++ b/src/core/function/ArchiveFileOperator.cpp @@ -136,8 +136,6 @@ void GpgFrontend::ArchiveFileOperator::CreateArchive( } for (;;) { - bool needcr = false; - entry = archive_entry_new(); r = archive_read_next_header2(disk, entry); @@ -149,15 +147,6 @@ void GpgFrontend::ArchiveFileOperator::CreateArchive( } archive_read_disk_descend(disk); -#ifdef WINDOWS - auto entry_path = - QString::fromStdWString(std::wstring(archive_entry_pathname_w(entry))) - .toUtf8() - .toStdString(); -#else - auto entry_path = std::string(archive_entry_pathname_utf8(entry)); -#endif - SPDLOG_DEBUG("Adding: {} size: {} bytes: {} file type: {}", archive_entry_pathname_utf8(entry), archive_entry_size(entry), archive_entry_filetype(entry)); @@ -201,7 +190,6 @@ void GpgFrontend::ArchiveFileOperator::ExtractArchive( struct archive *a; struct archive *ext; struct archive_entry *entry; - int r; a = archive_read_new(); ext = archive_write_disk_new(); @@ -241,8 +229,9 @@ void GpgFrontend::ArchiveFileOperator::ExtractArchive( archive_error_string(a)); throw std::runtime_error("archive_read_open_filename() failed"); } + for (;;) { - r = archive_read_next_header(a, &entry); + int r = archive_read_next_header(a, &entry); if (r == ARCHIVE_EOF) break; if (r != ARCHIVE_OK) { SPDLOG_ERROR("archive_read_next_header() failed: {}", |