Fix cppcheck reported issues (#333)

Fixes: https://github.com/microsoft/PowerToys/issues/266
This commit is contained in:
Bartosz Sosnowski
2019-09-11 12:38:20 +02:00
committed by GitHub
parent 12cd7bb49f
commit 8ac6db8b5a
19 changed files with 34 additions and 36 deletions

View File

@@ -155,7 +155,7 @@ public:
}
*/
}
catch (std::exception ex) {
catch (std::exception& ex) {
// Improper JSON.
}
}
@@ -201,7 +201,7 @@ public:
// Otherwise call a custom function to process the settings before saving them to disk:
// save_settings();
}
catch (std::exception ex) {
catch (std::exception& ex) {
// Improper JSON.
}
}
@@ -243,7 +243,7 @@ void $safeprojectname$::init_settings() {
try {
// Load and parse the settings file for this PowerToy.
PowerToysSettings::PowerToyValues settings =
PowerToysSettings::PowerToyValues::load_from_settings_file(get_name());
PowerToysSettings::PowerToyValues::load_from_settings_file($safeprojectname$::get_name());
// Load a bool property.
/*
@@ -273,7 +273,7 @@ void $safeprojectname$::init_settings() {
}
*/
}
catch (std::exception ex) {
catch (std::exception& ex) {
// Error while loading from the settings file. Let default values stay as they are.
}
}