mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02: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:
@@ -250,7 +250,7 @@ public:
|
||||
CSettingsInstance().SetMaxMRUSize(values.get_int_value(L"int_max_mru_size").value());
|
||||
CSettingsInstance().SetShowIconOnMenu(values.get_bool_value(L"bool_show_icon_on_menu").value());
|
||||
CSettingsInstance().SetExtendedContextMenuOnly(values.get_bool_value(L"bool_show_extended_menu").value());
|
||||
CSettingsInstance().SavePowerRenameData();
|
||||
CSettingsInstance().Save();
|
||||
|
||||
Trace::SettingsChanged();
|
||||
}
|
||||
@@ -283,7 +283,6 @@ public:
|
||||
|
||||
void init_settings()
|
||||
{
|
||||
CSettingsInstance().LoadPowerRenameData();
|
||||
m_enabled = CSettingsInstance().GetEnabled();
|
||||
Trace::EnablePowerRename(m_enabled);
|
||||
}
|
||||
@@ -291,7 +290,7 @@ public:
|
||||
void save_settings()
|
||||
{
|
||||
CSettingsInstance().SetEnabled(m_enabled);
|
||||
CSettingsInstance().SavePowerRenameData();
|
||||
CSettingsInstance().Save();
|
||||
Trace::EnablePowerRename(m_enabled);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user