From dacd752bbf46f2afb08b4b8d730ba3619528dda4 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Sun, 29 Sep 2024 12:51:41 -0500 Subject: Add more functionality in paging. --- src/archive.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/archive.cpp') 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(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(m_fileSizes[page])); - // auto index = m_sortedIndices[page]; - qDebug("Reading in page data"); auto bytesRead = zip_fread(file, data.data(), static_cast(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"); -- cgit v1.2.3