Always handle uncompressed tag map file

This commit is contained in:
Sébastien Fourey 2023-03-29 11:32:48 +02:00
parent 9503551691
commit 5dabfa9d5a
1 changed files with 1 additions and 5 deletions

View File

@ -71,17 +71,13 @@ void FiltersTagMap::load()
return;
}
if (jsonFile.open(QFile::ReadOnly)) {
#ifdef _GMIC_QT_DEBUG_
QJsonDocument jsonDoc;
QByteArray allFile = jsonFile.readAll();
if (allFile.startsWith("{")) {
if (allFile.startsWith("{")) { // Was created in debug mode
jsonDoc = QJsonDocument::fromJson(allFile);
} else {
jsonDoc = QJsonDocument::fromJson(qUncompress(allFile));
}
#else
QJsonDocument jsonDoc = QJsonDocument::fromJson(qUncompress(jsonFile.readAll()));
#endif
if (jsonDoc.isNull()) {
Logger::warning(QString("Cannot parse ") + jsonFilename);
Logger::warning("Filter tags are lost!");