MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / IntSettingSetterRestorer

Class IntSettingSetterRestorer

cppcryptfs/ui/MountPropertyPage.cpp:1291–1318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1289}
1290
1291struct IntSettingSetterRestorer {
1292 enum CryptSettingsRegistryValuesKeys m_key;
1293 int saved_val;
1294 int new_val;
1295 bool inited = false;
1296 void IntSettingSetterRestorer::init(enum CryptSettingsRegistryValuesKeys key, int newval)
1297 {
1298 inited = true;
1299
1300 m_key = key;
1301
1302 saved_val = 0;
1303 CryptSettings::getInstance().GetSettingCurrent(m_key, saved_val);
1304
1305 new_val = newval;
1306
1307 if (new_val != saved_val)
1308 CryptSettings::getInstance().SaveSetting(m_key, new_val);
1309 }
1310 ~IntSettingSetterRestorer()
1311 {
1312 if (inited) {
1313 if (new_val != saved_val) {
1314 CryptSettings::getInstance().SaveSetting(m_key, saved_val);
1315 }
1316 }
1317 }
1318};
1319
1320
1321void CMountPropertyPage::ProcessCommandLine(LPCWSTR szCmd, BOOL bOnStartup, HANDLE hPipe)

Callers

nothing calls this directly

Calls 2

GetSettingCurrentMethod · 0.80
SaveSettingMethod · 0.80

Tested by

no test coverage detected