Check whether mProFile is a directory
We do sometimes save a dir in mProFileName. This is so that we can open that directory, when the user selects a project.
We currently check for that by using QFileInfo::isDir
, which returns false
, if the given path does not exist. That means that we can load a dir, and because it does not exist, we treat it as a (successfully loaded) file.
We should instead add our own helper function, which not only test whether the given path corresponds to a dir, but also whether the given path exists. Of course, all existing differentiations between dir and file would need to be updated.
A bug that is caused by this is that PeTrack can ask whether one wants to save the existing project when opening a new one, despite it being the first project being opened.