mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-23 23:13:12 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user