Utils: Do not save file upon PersistentSettingsWriter destruction

The m_savedData member is set on two occasions: Once directly after
reading the same file that is going to be written, and once directly
after a successful file save. In neither case do we have to write it out
again.

Fixes: QTCREATORBUG-25921
Change-Id: Ie369e280f4189aefb6b2ad291426ee9e6f1ed16d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2021-07-02 15:37:12 +02:00
parent 8cc4bbe4d8
commit 2e9604c092
2 changed files with 0 additions and 6 deletions

View File

@@ -427,11 +427,6 @@ PersistentSettingsWriter::PersistentSettingsWriter(const FilePath &fileName, con
m_fileName(fileName), m_docType(docType)
{ }
PersistentSettingsWriter::~PersistentSettingsWriter()
{
write(m_savedData, nullptr);
}
bool PersistentSettingsWriter::save(const QVariantMap &data, QString *errorString) const
{
if (data == m_savedData)

View File

@@ -52,7 +52,6 @@ class QTCREATOR_UTILS_EXPORT PersistentSettingsWriter
{
public:
PersistentSettingsWriter(const FilePath &fileName, const QString &docType);
~PersistentSettingsWriter();
bool save(const QVariantMap &data, QString *errorString) const;
#ifdef QT_GUI_LIB