Allow space characters in table and index names, disallow ` chars

Spaces in table, index and field names are actually allowed by SQLite,
so no need to check for them.
However, "`" characters cause problems when appearing in SQL statements
so disallow them instead.
This commit is contained in:
Martin Kleusberg
2014-01-16 19:56:58 +01:00
parent 0632ecc35f
commit 0ae6f1895e
3 changed files with 4 additions and 8 deletions

View File

@@ -149,9 +149,8 @@ void EditTableDialog::updateSqlText()
void EditTableDialog::checkInput()
{
QString normTableName = ui->editTableName->text().trimmed();
ui->editTableName->setText(normTableName);
bool valid = true;
if(normTableName.isEmpty() || normTableName.contains(" "))
if(normTableName.isEmpty() || normTableName.contains("`"))
valid = false;
if(ui->treeWidget->topLevelItemCount() == 0)
valid = false;