From 0a2e53caf27b30186f8492fcfb6efa61ca7808b1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 4 Dec 2017 08:49:28 +0100 Subject: 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 --- desktop-widgets/divelogexportdialog.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'desktop-widgets/divelogexportdialog.cpp') diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp index ed908e937..96417c1bc 100644 --- a/desktop-widgets/divelogexportdialog.cpp +++ b/desktop-widgets/divelogexportdialog.cpp @@ -127,9 +127,8 @@ void DiveLogExportDialog::on_buttonBox_accepted() 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(); - } } settings.endGroup(); -- cgit v1.2.3-70-g09d2