From fe3dfe67748f1492e865494271c1a6c81ae24421 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Thu, 25 Mar 2021 02:20:16 -0500 Subject: [PATCH] Bug 2716 - Cleared "Recent Files" are restored on next launch --- src/widgets/FileConfig.cpp | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/src/widgets/FileConfig.cpp b/src/widgets/FileConfig.cpp index e0e1db83b..2848d6c62 100644 --- a/src/widgets/FileConfig.cpp +++ b/src/widgets/FileConfig.cpp @@ -194,27 +194,52 @@ bool FileConfig::Flush(bool WXUNUSED(bCurrentOnly)) bool FileConfig::RenameEntry(const wxString& oldName, const wxString& newName) { - return mConfig->RenameEntry(oldName, newName); + auto res = mConfig->RenameEntry(oldName, newName); + if (res) + { + mDirty = true; + } + return res; } bool FileConfig::RenameGroup(const wxString& oldName, const wxString& newName) { - return mConfig->RenameGroup(oldName, newName); + auto res = mConfig->RenameGroup(oldName, newName); + if (res) + { + mDirty = true; + } + return res; } bool FileConfig::DeleteEntry(const wxString& key, bool bDeleteGroupIfEmpty) { - return mConfig->DeleteEntry(key, bDeleteGroupIfEmpty); + auto res = mConfig->DeleteEntry(key, bDeleteGroupIfEmpty); + if (res) + { + mDirty = true; + } + return res; } bool FileConfig::DeleteGroup(const wxString& key) { - return mConfig->DeleteGroup(key); + auto res = mConfig->DeleteGroup(key); + if (res) + { + mDirty = true; + } + return res; } bool FileConfig::DeleteAll() { - return mConfig->DeleteAll(); + auto res = mConfig->DeleteAll(); + if (res) + { + mDirty = true; + } + return res; } bool FileConfig::DoReadString(const wxString& key, wxString *pStr) const