Migrate power rename MRU lists from registry to JSON (#2090)

* Handle most recently used search/replace strings within settings.

* Check for last modified time of json file and reload it if needed.

* Handle changes in MRU search / replace lists size.

* Improve handling of changes in MRU list size.

* Don't check for last modified time in every getter method. Load only when starting application.

* Add const identifier to getter methods.

* Address PR comments: Add const to reg and json file paths and set them in constructor initializer. Check pushIdx validity. Move implementation to cpp of PowerRenameUI constructor.

* Add error checking when getting values from registry.
This commit is contained in:
vldmr11080
2020-04-15 23:14:17 +02:00
committed by GitHub
parent 67e6688e69
commit aa6cb7d650
5 changed files with 308 additions and 262 deletions

View File

@@ -5,7 +5,6 @@
#include <commctrl.h>
#include <Shlobj.h>
#include <helpers.h>
#include <settings.h>
#include <windowsx.h>
#include <thread>
#include <trace.h>
@@ -80,6 +79,14 @@ inline int RECT_HEIGHT(RECT& r)
return r.bottom - r.top;
}
CPowerRenameUI::CPowerRenameUI() :
m_refCount(1)
{
CSettingsInstance().Load();
(void)OleInitialize(nullptr);
ModuleAddRef();
}
// IUnknown
IFACEMETHODIMP CPowerRenameUI::QueryInterface(__in REFIID riid, __deref_out void** ppv)
{