From 66795fa02a6133abab5f79eefeba8a994e7d23f3 Mon Sep 17 00:00:00 2001 From: Sergey POKHODENKO Date: Tue, 19 May 2015 10:07:51 +0300 Subject: [PATCH] ModuleBase_WidgetFileSelector uses curent value as default for the dialog --- src/ModuleBase/ModuleBase_WidgetFileSelector.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp index c7fcacd11..139b3849a 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp @@ -111,10 +111,11 @@ bool ModuleBase_WidgetFileSelector::isCurrentPathValid() void ModuleBase_WidgetFileSelector::onPathSelectionBtn() { + QString aDefaultPath = myPathField->text().isEmpty() ? myDefaultPath : myPathField->text(); QString aFilter = filterString(); QString aFileName = (myType == WFS_SAVE) - ? QFileDialog::getSaveFileName(this, myTitle, myDefaultPath, aFilter) - : QFileDialog::getOpenFileName(this, myTitle, myDefaultPath, aFilter); + ? QFileDialog::getSaveFileName(this, myTitle, aDefaultPath, aFilter) + : QFileDialog::getOpenFileName(this, myTitle, aDefaultPath, aFilter); if (!aFileName.isEmpty()) { myPathField->setText(aFileName); } -- 2.39.2