Always handle uncompressed parameters cache
This commit is contained in:
parent
5dabfa9d5a
commit
070b9403e4
|
@ -56,17 +56,13 @@ void ParametersCache::load(bool loadFiltersParameters)
|
|||
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("Last filters parameters are lost!");
|
||||
|
|
Loading…
Reference in New Issue