Use wxLogNull to temporarily disable logging in wxZipInputStream

Using this class is simpler, more efficient and MT-safe, which is
important because wxZipInputStream can be used from a background thread
(e.g. to decompress a file downloaded from the network etc).
This commit is contained in:
Vadim Zeitlin
2022-12-18 21:42:00 +01:00
parent 2c937f4ae7
commit c7255734dd
+2 -7
View File
@@ -146,14 +146,9 @@ static inline wxUint16 CrackUint16(const char *m)
static wxFileOffset QuietSeek(wxInputStream& stream, wxFileOffset pos)
{
#if wxUSE_LOG
wxLogLevel level = wxLog::GetLogLevel();
wxLog::SetLogLevel(wxLOG_Debug - 1);
wxFileOffset result = stream.SeekI(pos);
wxLog::SetLogLevel(level);
return result;
#else
return stream.SeekI(pos);
wxLogNull noLog;
#endif
return stream.SeekI(pos);
}