Profile removal when name is empty
When adding a new profile and leave it empty, an IndexError is raised.
Also the cursor is set on the last profile but the db list is not refreshed.
Finally, when editing to an existing name, it is deleted even if it was filled with different values. I think it should reset to the previous name.