- QString aFilter = formatsString(myFormats);
- QString aFileName = QFileDialog::getOpenFileName(myMainWidget, myTitle, myDefaultPath, aFilter);
+ QString aDefaultPath = myPathField->text().isEmpty()
+ ? myDefaultPath
+ : QFileInfo(myPathField->text()).absolutePath();
+ QString aFilter = filterString();
+ QString aFileName = (myType == WFS_SAVE)
+ ? QFileDialog::getSaveFileName(this, myTitle, aDefaultPath, aFilter, &mySelectedFilter)
+ : QFileDialog::getOpenFileName(this, myTitle, aDefaultPath, aFilter, &mySelectedFilter);