mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 11:45:47 +00:00
Closes #12 Adds a menu option to install firmware from a packed ZIP. This PR additionally lays the groundwork to add data import/export via ZIP. In the future, a qt_common subproject should be added to handle common Qt tasks such as this. Furthermore, to decrease dependency complexity, this also introduces CPM, a wrapper around FetchContent. In theory, this should also lay the groundwork for #8 as well. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/52
80 lines
3 KiB
Diff
80 lines
3 KiB
Diff
diff --git a/quazip/quazipdir.cpp b/quazip/quazipdir.cpp
|
|
index d43f1c1..eb24bf1 100644
|
|
--- a/quazip/quazipdir.cpp
|
|
+++ b/quazip/quazipdir.cpp
|
|
@@ -293,8 +293,8 @@ bool QuaZipDirComparator::operator()(const QuaZipFileInfo64 &info1,
|
|
}
|
|
|
|
template<typename TFileInfoList>
|
|
-bool QuaZipDirPrivate::entryInfoList(QStringList nameFilters,
|
|
- QDir::Filters filter, QDir::SortFlags sort, TFileInfoList &result) const
|
|
+bool QuaZipDirPrivate::entryInfoList(QStringList _nameFilters,
|
|
+ QDir::Filters _filter, QDir::SortFlags sort, TFileInfoList &result) const
|
|
{
|
|
QString basePath = simplePath();
|
|
if (!basePath.isEmpty())
|
|
@@ -305,12 +305,12 @@ bool QuaZipDirPrivate::entryInfoList(QStringList nameFilters,
|
|
if (!zip->goToFirstFile()) {
|
|
return zip->getZipError() == UNZ_OK;
|
|
}
|
|
- QDir::Filters fltr = filter;
|
|
+ QDir::Filters fltr = _filter;
|
|
if (fltr == QDir::NoFilter)
|
|
fltr = this->filter;
|
|
if (fltr == QDir::NoFilter)
|
|
fltr = QDir::AllEntries;
|
|
- QStringList nmfltr = nameFilters;
|
|
+ QStringList nmfltr = _nameFilters;
|
|
if (nmfltr.isEmpty())
|
|
nmfltr = this->nameFilters;
|
|
QSet<QString> dirsFound;
|
|
diff --git a/quazip/quazipfile.cpp b/quazip/quazipfile.cpp
|
|
index 4a5f2f9..f7865f5 100644
|
|
--- a/quazip/quazipfile.cpp
|
|
+++ b/quazip/quazipfile.cpp
|
|
@@ -241,14 +241,14 @@ void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs
|
|
p->caseSensitivity=cs;
|
|
}
|
|
|
|
-void QuaZipFilePrivate::setZipError(int zipError) const
|
|
+void QuaZipFilePrivate::setZipError(int _zipError) const
|
|
{
|
|
QuaZipFilePrivate *fakeThis = const_cast<QuaZipFilePrivate*>(this); // non-const
|
|
- fakeThis->zipError=zipError;
|
|
- if(zipError==UNZ_OK)
|
|
+ fakeThis->zipError = _zipError;
|
|
+ if(_zipError == UNZ_OK)
|
|
q->setErrorString(QString());
|
|
else
|
|
- q->setErrorString(QuaZipFile::tr("ZIP/UNZIP API error %1").arg(zipError));
|
|
+ q->setErrorString(QuaZipFile::tr("ZIP/UNZIP API error %1").arg(_zipError));
|
|
}
|
|
|
|
bool QuaZipFile::open(OpenMode mode)
|
|
diff --git a/quazip/unzip.c b/quazip/unzip.c
|
|
index a39365d..ee7b487 100644
|
|
--- a/quazip/unzip.c
|
|
+++ b/quazip/unzip.c
|
|
@@ -1054,7 +1054,7 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file,
|
|
/* ZIP64 extra fields */
|
|
if (headerId == 0x0001)
|
|
{
|
|
- uLong uL;
|
|
+ uLong _uL;
|
|
|
|
if(file_info.uncompressed_size == (ZPOS64_T)0xFFFFFFFFu)
|
|
{
|
|
@@ -1078,7 +1078,7 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file,
|
|
if(file_info.disk_num_start == 0xFFFFFFFFu)
|
|
{
|
|
/* Disk Start Number */
|
|
- if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
|
|
+ if (unz64local_getLong(&s->z_filefunc, s->filestream, &_uL) != UNZ_OK)
|
|
err=UNZ_ERRNO;
|
|
}
|
|
|
|
@@ -2151,3 +2151,4 @@ int ZEXPORT unzClearFlags(unzFile file, unsigned flags)
|
|
s->flags &= ~flags;
|
|
return UNZ_OK;
|
|
}
|
|
+
|