Dropped unreachable code
Used switch statement with fall through instead of recurring ifs

The '// fall through' comments remove warning M20. See:
http://qt-project.org/doc/qtcreator-2.6/creator-checking-code-syntax.html#list-of-javascript-and-qml-checks
Merge pull request #24 from michael-k/database

Database