some code style improvements

This commit is contained in:
Alberto Griggio
2017-03-05 18:10:42 +01:00
parent f8bf8d18dc
commit 43e32e81ef
4 changed files with 10 additions and 6 deletions

View File

@@ -517,16 +517,15 @@ void DynamicProfilePanel::on_button_edit()
void DynamicProfilePanel::save()
{
auto &rules = profileStore.getDynamicProfileRules();
rules.clear();
std::vector<DynamicProfileRule> rules;
int serial = 1;
for (auto row : treemodel_->children()) {
rules.emplace_back(to_rule(row, serial++));
}
if (!storeDynamicProfileRules(rules)) {
printf("Error in saving dynamic profile rules\n");
rules.clear();
} else {
profileStore.setDynamicProfileRules(rules);
printf("Saved %d dynamic profile rules\n", int(rules.size()));
}
}