mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user