UI: Import profiles from ZIP supporting bigger files (Bugfix)
This patch allows the profile importer to recover from a file too large to import as well as adjusts the maximum allowed config file size. Closes: #17504
This commit is contained in:
parent
d884af52e9
commit
8e2cd4f652
|
@ -1091,7 +1091,8 @@ bool ProfileModel::acceptFile(QString fileName, int fileSize)
|
|||
if (fileName.toLower().endsWith(".zip"))
|
||||
return false;
|
||||
|
||||
if (fileSize > 1024 * 512)
|
||||
/* Arbitrary maximum config file size accepted: 256MB */
|
||||
if (fileSize > 1024 * 1024 * 256)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
|
@ -67,7 +67,17 @@ bool WiresharkZipHelper::unzip(QString zipFile, QString directory, bool (*fileCh
|
|||
|
||||
/* Sanity check for the file */
|
||||
if (fileInZip.length() == 0 || (fileCheck && ! fileCheck(fileInZip, fileSize)) )
|
||||
{
|
||||
if ((cnt + 1) < nmbr)
|
||||
{
|
||||
err = unzGoToNextFile(uf);
|
||||
if (err != UNZ_OK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (di.exists())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue