rbutil: Update vendored quazip from v1.1 to v1.3

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Sun, 21 Jun 2026 08:56:02 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 1e3301388ca1f5cb44a4ac12a990e17a18f3d842
Author: Solomon Peachy <[email protected]>
Date:   Sun Jun 21 08:55:26 2026 -0400

    rbutil:  Update vendored quazip from v1.1 to v1.3
    
    Change-Id: Icd6f010adbc9712f381a409eca31506fe31bb304

diff --git a/utils/rbutilqt/quazip/README.ROCKBOX b/utils/rbutilqt/quazip/README.ROCKBOX
index 2e1dca737f..de8960d83d 100644
--- a/utils/rbutilqt/quazip/README.ROCKBOX
+++ b/utils/rbutilqt/quazip/README.ROCKBOX
@@ -3,7 +3,7 @@ These files are distributed under the LGPL v2.1 or later. Only source files
 actually used in Rockbox Utility are included, further sources have been left
 out. Check the quazip source distribution for those.
 
-The source files have been last synced with the project's release 1.1 at
-https://github.com/stachenov/quazip/ on October 11, 2020.
+The source files have been last synced with the project's release 1.3 at
+https://github.com/stachenov/quazip/ from April 16, 2022.
 
 
diff --git a/utils/rbutilqt/quazip/quazip.cpp b/utils/rbutilqt/quazip/quazip.cpp
index 29a278da29..1f1f39770c 100644
--- a/utils/rbutilqt/quazip/quazip.cpp
+++ b/utils/rbutilqt/quazip/quazip.cpp
@@ -349,7 +349,6 @@ void QuaZip::close()
   p->zipError=UNZ_OK;
   switch(p->mode) {
     case mdNotOpen:
-      qWarning("QuaZip::close(): ZIP is not open");
       return;
     case mdUnzip:
       p->zipError=unzClose(p->unzFile_f);
@@ -371,8 +370,7 @@ void QuaZip::close()
       p->ioDevice = nullptr;
   }
   p->clearDirectoryMap();
-  if(p->zipError==UNZ_OK)
-    p->mode=mdNotOpen;
+  p->mode=mdNotOpen;
 }
 
 void QuaZip::setZipName(const QString& zipName)
diff --git a/utils/rbutilqt/quazip/quazip.h b/utils/rbutilqt/quazip/quazip.h
index 486d5885bf..488c3a981b 100644
--- a/utils/rbutilqt/quazip/quazip.h
+++ b/utils/rbutilqt/quazip/quazip.h
@@ -213,6 +213,11 @@ class QUAZIP_EXPORT QuaZip {
      * but at least it makes your programs work instead of crashing. Note that
      * if the auto-close flag is cleared, then this is a non-issue, and
      * commit() isn't called.
+     *
+     * Closing an already closed (or never opened) instance is safe,
+     * regardless of whether the first close attempt was successful.
+     * This second close does nothing, but is considered a success,
+     * as far as getZipError() is concerned.
       */
     void close();
     /// Sets the codec used to encode/decode file names inside archive.
diff --git a/utils/rbutilqt/quazip/quazip_global.h b/utils/rbutilqt/quazip/quazip_global.h
index de581bd7c4..ffbf3b5486 100644
--- a/utils/rbutilqt/quazip/quazip_global.h
+++ b/utils/rbutilqt/quazip/quazip_global.h
@@ -25,7 +25,7 @@ Original ZIP package is copyrighted by Gilles Vollant and contributors,
 see quazip/(un)zip.h files for details. Basically it's the zlib license.
 */
 
-#include <QtCore/qglobal.h>
+#include <QtCore/QtGlobal>
 
 /**
   This is automatically defined when building a static library, but when
diff --git a/utils/rbutilqt/quazip/quazip_qt_compat.h b/utils/rbutilqt/quazip/quazip_qt_compat.h
index d1c912a04d..48024be568 100644
--- a/utils/rbutilqt/quazip/quazip_qt_compat.h
+++ b/utils/rbutilqt/quazip/quazip_qt_compat.h
@@ -9,8 +9,8 @@
  * Some includes are repeated just in case we want to split this file later.
  */
 
-#include <Qt>
-#include <QtGlobal>
+#include <QtCore/Qt>
+#include <QtCore/QtGlobal>
 
 // Legacy encodings are still everywhere, but the Qt team decided we
 // don't need them anymore and moved them out of Core in Qt 6.
@@ -46,12 +46,12 @@ inline bool quazip_close(QIODevice *device) {
 #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
 using Qt::SkipEmptyParts;
 #else
-#include <QString>
+#include <QtCore/QString>
 const auto SkipEmptyParts = QString::SplitBehavior::SkipEmptyParts;
 #endif
 
 // and yet another... (why didn't they just make qSort delegate to std::sort?)
-#include <QList>
+#include <QtCore/QList>
 #if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
 #include <algorithm>
 template<typename T, typename C>
@@ -59,7 +59,7 @@ inline void quazip_sort(T begin, T end, C comparator) {
     std::sort(begin, end, comparator);
 }
 #else
-#include <QtAlgorithms>
+#include <QtCore/QtAlgorithms>
 template<typename T, typename C>
 inline void quazip_sort(T begin, T end, C comparator) {
     qSort(begin, end, comparator);
@@ -67,8 +67,8 @@ inline void quazip_sort(T begin, T end, C comparator) {
 #endif
 
 // this is a stupid rename...
-#include <QDateTime>
-#include <QFileInfo>
+#include <QtCore/QDateTime>
+#include <QtCore/QFileInfo>
 #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
 inline QDateTime quazip_ctime(const QFileInfo &fi) {
     return fi.birthTime();
@@ -79,8 +79,33 @@ inline QDateTime quazip_ctime(const QFileInfo &fi) {
 }
 #endif
 
+// this is just a slightly better alternative
+#include <QtCore/QFileInfo>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+inline bool quazip_is_symlink(const QFileInfo &fi) {
+    return fi.isSymbolicLink();
+}
+#else
+inline bool quazip_is_symlink(const QFileInfo &fi) {
+    // also detects *.lnk on Windows, but better than nothing
+    return fi.isSymLink();
+}
+#endif
+
+// I'm not even sure what this one is, but nevertheless
+#include <QtCore/QFileInfo>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
+inline QString quazip_symlink_target(const QFileInfo &fi) {
+    return fi.symLinkTarget();
+}
+#else
+inline QString quazip_symlink_target(const QFileInfo &fi) {
+    return fi.readLink(); // What's the difference? I've no idea.
+}
+#endif
+
 // this is not a deprecation but an improvement, for a change
-#include <QDateTime>
+#include <QtCore/QDateTime>
 #if (QT_VERSION >= 0x040700)
 inline quint64 quazip_ntfs_ticks(const QDateTime &time, int fineTicks) {
     QDateTime base(QDate(1601, 1, 1), QTime(0, 0), Qt::UTC);
@@ -98,7 +123,7 @@ inline quint64 quazip_ntfs_ticks(const QDateTime &time, int fineTicks) {
 #endif
 
 // yet another improvement...
-#include <QDateTime>
+#include <QtCore/QDateTime>
 #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) // Yay! Finally a way to get time as qint64!
 inline qint64 quazip_to_time64_t(const QDateTime &time) {
     return time.toSecsSinceEpoch();
@@ -109,7 +134,7 @@ inline qint64 quazip_to_time64_t(const QDateTime &time) {
 }
 #endif
 
-#include <QTextStream>
+#include <QtCore/QTextStream>
 // and another stupid move
 #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
 const auto quazip_endl = Qt::endl;
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs