qtbase-zlib-compression.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From cbdc9a7786278c31fdb6eb465f32d0374349c1ef Mon Sep 17 00:00:00 2001
  2. From: Thiago Macieira <thiago.macieira@intel.com>
  3. Date: Thu, 20 Jun 2019 09:36:46 -0700
  4. Subject: RCC: Change the default compression to Zlib
  5. Codebases using QResource::isCompressed() and assuming it is Zlib break
  6. if zstd is enabled. So change the default back to Zlib until Qt 6.0.
  7. [ChangeLog][Important Behavior Changes] RCC's default compression
  8. algorithm was changed back to Zlib, as it was in all previous releases
  9. until 5.13.0. The default will remain Zlib for all Qt 5.x releases but
  10. will change in Qt 6.0. To activate Zstd compression for your resources,
  11. either pass the --compress-algo=zstd option to the rcc tool or add the
  12. XML attribute compression-algorithm="zstd" to the <file> tags in the
  13. .qrc file.
  14. Task-number: QTBUG-76521
  15. Change-Id: Ief874765cd7b43798de3fffd15a9f56fd9ad1ad4
  16. Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
  17. ---
  18. src/tools/rcc/rcc.cpp | 2 +-
  19. 1 file changed, 1 insertion(+), 1 deletion(-)
  20. diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
  21. index 862e574f2d..011a7db810 100644
  22. --- a/src/tools/rcc/rcc.cpp
  23. +++ b/src/tools/rcc/rcc.cpp
  24. @@ -58,7 +58,7 @@ enum {
  25. CONSTANT_COMPRESSTHRESHOLD_DEFAULT = 70
  26. };
  27. -#if QT_CONFIG(zstd)
  28. +#if QT_CONFIG(zstd) && QT_VERSION >= QT_VERSION_CHECK(6,0,0)
  29. # define CONSTANT_COMPRESSALGO_DEFAULT RCCResourceLibrary::CompressionAlgorithm::Zstd
  30. #elif !defined(QT_NO_COMPRESS)
  31. # define CONSTANT_COMPRESSALGO_DEFAULT RCCResourceLibrary::CompressionAlgorithm::Zlib
  32. --
  33. cgit v1.2.1