Replaced redundant makePathRelative with QDir::relativeFilePAth() which was probably also causing lots of "../" in the relative path of the last opened database.