ui: Filepicker fixes

* don't reset filepath used to open file picker dialog for SaveFileDialog
* don't reset filepath used to open filepicker for OpenProject dialog
* fixed non-native file picker starts in wrong directory if provided with filename to open (instead of directory)
* fixed non-native dialog displays machines root directory if empty path is provided
This commit is contained in:
mlangkabel
2018-01-26 12:43:17 +01:00
parent ae66220ca9
commit 7ec02d28ea
6 changed files with 26 additions and 19 deletions
+2 -2
View File
@@ -108,11 +108,11 @@ void QtLocationPicker::handleButtonPress()
QString fileName;
if (m_pickDirectory)
{
fileName = QtFileDialog::getExistingDirectory(this, tr("Select Directory"), QString::fromStdString(path.str()));
fileName = QtFileDialog::getExistingDirectory(this, tr("Select Directory"), path);
}
else
{
fileName = QtFileDialog::getOpenFileName(this, tr("Open File"), QString::fromStdString(path.str()), m_fileFilter);
fileName = QtFileDialog::getOpenFileName(this, tr("Open File"), path, m_fileFilter);
}
if (!fileName.isEmpty())