[ion] Storage: make Storage::nameCompliant less restrictive (accepts

.*\.[a-z]+). But Script::nameCompliant is stricted: [a-z_0-9.]*
This commit is contained in:
Émilie Feral
2018-09-13 11:07:16 +02:00
parent 51341f4abe
commit 08077cb141
6 changed files with 24 additions and 11 deletions

View File

@@ -316,7 +316,7 @@ bool MenuController::textFieldDidFinishEditing(TextField * textField, const char
} else {
newName = text;
}
Script::ErrorStatus error = m_scriptStore->scriptAtIndex(m_selectableTableView.selectedRow()).setName(newName);
Script::ErrorStatus error = Script::nameCompliant(newName) ? m_scriptStore->scriptAtIndex(m_selectableTableView.selectedRow()).setName(newName) : Script::ErrorStatus::NonCompliantName;
if (error == Script::ErrorStatus::None) {
updateAddScriptRowDisplay();
textField->setText(newName);