From 5139c04c210199836b35d305933e3953c327c5ed Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 14 May 2021 13:21:18 +0200 Subject: [PATCH] ResourceEditor: Do not lose the compress-algo attribute ...when editing via the UI. Fixes: QTCREATORBUG-25706 Change-Id: I6ffef2d79188e42182dcb680a22f8b3b933a61e2 Reviewed-by: hjk --- src/plugins/resourceeditor/qrceditor/resourcefile.cpp | 3 +++ src/plugins/resourceeditor/qrceditor/resourcefile_p.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 98306e45ec7..88b86ff9b41 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -190,6 +190,7 @@ Core::IDocument::OpenResult ResourceFile::load() const QString alias = felt.attribute(QLatin1String("alias")); File * const file = new File(p, fileName, alias); file->compress = felt.attribute(QLatin1String("compress")); + file->compressAlgo = felt.attribute(QLatin1String("compress-algo")); file->threshold = felt.attribute(QLatin1String("threshold")); p->file_list.append(file); } @@ -226,6 +227,8 @@ QString ResourceFile::contents() const felt.setAttribute(QLatin1String("alias"), file.alias); if (!file.compress.isEmpty()) felt.setAttribute(QLatin1String("compress"), file.compress); + if (!file.compressAlgo.isEmpty()) + felt.setAttribute(QLatin1String("compress-algo"), file.compressAlgo); if (!file.threshold.isEmpty()) felt.setAttribute(QLatin1String("threshold"), file.threshold); } diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h index 0afb55290cf..a48fa402f14 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h +++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h @@ -84,6 +84,7 @@ public: // not used, only loaded and saved QString compress; + QString compressAlgo; QString threshold; private: