mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use QDir::exists() instead of QDir::setCurrent() to check for existence
Don't change into a directory just to see if it exists. Remove unnecessary braces of one of the changed if statements. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ed92b60bfe
commit
0a2e53caf2
4 changed files with 4 additions and 5 deletions
|
@ -743,7 +743,7 @@ QString MainWindow::lastUsedDir()
|
|||
|
||||
settings.beginGroup("FileDialog");
|
||||
if (settings.contains("LastDir"))
|
||||
if (QDir::setCurrent(settings.value("LastDir").toString()))
|
||||
if (QDir(settings.value("LastDir").toString()).exists())
|
||||
lastDir = settings.value("LastDir").toString();
|
||||
return lastDir;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue