mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-24 04:12:32 +08:00
[FileLocksmith][PowerRename]Fix regression by reloading module settings (#32192)
This commit is contained in:
parent
b31eaf3a0b
commit
7b89482b94
@ -15,6 +15,7 @@ public:
|
||||
return true;
|
||||
if (gpoSetting == powertoys_gpo::gpo_rule_configured_disabled)
|
||||
return false;
|
||||
Reload();
|
||||
RefreshEnabledState();
|
||||
return settings.enabled;
|
||||
}
|
||||
|
@ -72,6 +72,17 @@ void CSettings::Load()
|
||||
}
|
||||
}
|
||||
|
||||
void CSettings::Reload()
|
||||
{
|
||||
// Load json settings from data file if it is modified in the meantime.
|
||||
FILETIME lastModifiedTime{};
|
||||
if (LastModifiedTime(moduleJsonFilePath, &lastModifiedTime) &&
|
||||
CompareFileTime(&lastModifiedTime, &lastLoadedTime) == 1)
|
||||
{
|
||||
Load();
|
||||
}
|
||||
}
|
||||
|
||||
void CSettings::RefreshEnabledState()
|
||||
{
|
||||
// Load json settings from data file if it is modified in the meantime.
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
return true;
|
||||
if (gpoSetting == powertoys_gpo::gpo_rule_configured_disabled)
|
||||
return false;
|
||||
Reload();
|
||||
RefreshEnabledState();
|
||||
return settings.enabled;
|
||||
}
|
||||
@ -106,6 +107,7 @@ private:
|
||||
unsigned int flags{ 0 };
|
||||
};
|
||||
|
||||
void Reload();
|
||||
void RefreshEnabledState();
|
||||
void MigrateFromRegistry();
|
||||
void ParseJson();
|
||||
|
Loading…
Reference in New Issue
Block a user