summaryrefslogtreecommitdiff
path: root/src/archive.cpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-09-29 12:51:41 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-09-29 12:51:41 -0500
commitdacd752bbf46f2afb08b4b8d730ba3619528dda4 (patch)
tree2554b12d3a6cb6d66fe28a89ccf132f6ae4b4aad /src/archive.cpp
parent06663d34c7678aa723955e64cd82a2e399c4b8c6 (diff)
Add more functionality in paging.
Diffstat (limited to 'src/archive.cpp')
-rw-r--r--src/archive.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/archive.cpp b/src/archive.cpp
index 1ce79b4..468efed 100644
--- a/src/archive.cpp
+++ b/src/archive.cpp
@@ -81,7 +81,6 @@ fud::FudStatus ZipArchive::populate()
return FudStatus::Failure;
}
size_t numEntries = static_cast<size_t>(numEntriesResult);
- qDebug("%zu pages", numEntries);
struct NameIndex {
std::string name;
@@ -103,7 +102,7 @@ fud::FudStatus ZipArchive::populate()
static_assert(ZIP_STAT_NAME != 0);
static_assert(ZIP_STAT_SIZE != 0);
static_assert(ZIP_STAT_INDEX != 0);
- // auto* nameCString = zip_get_name(m_archive, idx, ZIP_FL_ENC_RAW);
+
auto* nameCString = stats.name;
if (nameCString == nullptr) {
zip_error_t* error = zip_get_error(m_archive);
@@ -112,7 +111,6 @@ fud::FudStatus ZipArchive::populate()
}
std::string name{nameCString};
if (name.empty() || name.back() == '/') {
- qDebug("Directory %s", name.empty() ? "N/A" : nameCString);
continue;
}
@@ -120,7 +118,6 @@ fud::FudStatus ZipArchive::populate()
m_pages.emplace_back(std::nullopt);
}
-
if (m_pages.empty()) {
return FudStatus::Empty;
}
@@ -144,13 +141,11 @@ fud::FudStatus ZipArchive::populate()
ArchiveResult ZipArchive::getPage(size_t page)
{
- qDebug("Getting page %zu", page);
if (page > m_sortedIndices.size()) {
return ArchiveResult::error(ArchiveError::BadIndex);
}
if (m_pages[page] != std::nullopt) {
- qDebug("Page found %zu", page);
return ArchiveResult::okay(std::cref(*m_pages[page]));
}
@@ -163,9 +158,7 @@ ArchiveResult ZipArchive::getPage(size_t page)
QByteArray data;
data.resize(static_cast<qsizetype>(m_fileSizes[page]));
- // auto index = m_sortedIndices[page];
- qDebug("Reading in page data");
auto bytesRead = zip_fread(file, data.data(), static_cast<size_t>(data.size()));
zip_fclose(file);
file = nullptr;
@@ -175,7 +168,6 @@ ArchiveResult ZipArchive::getPage(size_t page)
}
m_pages[page] = QImage();
- qDebug("Loading QImage from page data");
auto loaded = m_pages[page]->loadFromData(data);
if (!loaded) {
qWarning("Failed to load QImage");