From ed296e4587a00a0a6361cec4f7ba94ad645576a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 30 Nov 2024 01:28:53 +0100 Subject: [PATCH] ZipFileReader: Save the zip path so we can log it --- Common/File/VFS/ZipFileReader.cpp | 2 +- Common/File/VFS/ZipFileReader.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Common/File/VFS/ZipFileReader.cpp b/Common/File/VFS/ZipFileReader.cpp index b51b7f4793..4bf3c7f876 100644 --- a/Common/File/VFS/ZipFileReader.cpp +++ b/Common/File/VFS/ZipFileReader.cpp @@ -44,7 +44,7 @@ ZipFileReader *ZipFileReader::Create(const Path &zipFile, const char *inZipPath, if (!path.empty() && path.back() != '/') { path.push_back('/'); } - return new ZipFileReader(zip_file, path); + return new ZipFileReader(zip_file, zipFile, path); } ZipFileReader::~ZipFileReader() { diff --git a/Common/File/VFS/ZipFileReader.h b/Common/File/VFS/ZipFileReader.h index 30c61ccc76..4bd510b463 100644 --- a/Common/File/VFS/ZipFileReader.h +++ b/Common/File/VFS/ZipFileReader.h @@ -36,15 +36,21 @@ public: bool GetFileListing(const char *path, std::vector *listing, const char *filter) override; bool GetFileInfo(const char *path, File::FileInfo *info) override; std::string toString() const override { - return inZipPath_; + std::string retval = zipPath_.ToVisualString(); + if (!inZipPath_.empty()) { + retval += ": "; + retval += inZipPath_; + } + return retval; } private: - ZipFileReader(zip *zip_file, const std::string &inZipPath) : zip_file_(zip_file), inZipPath_(inZipPath) {} + ZipFileReader(zip *zip_file, const Path &zipPath, const std::string &inZipPath) : zip_file_(zip_file), zipPath_(zipPath), inZipPath_(inZipPath) {} // Path has to be either an empty string, or a string ending with a /. bool GetZipListings(const std::string &path, std::set &files, std::set &directories); zip *zip_file_ = nullptr; std::mutex lock_; std::string inZipPath_; + Path zipPath_; };