QFileDialog::setDirectory() and directory() should be symmetric
QFileDialog::setDirectory() calls options->setInitialDirectory(). Then QFileDialogPrivate::helperPrepareShow() calls it again with the result of QFileDialog::directory(). Assuming there are cases where that's actually necessary, we need QFileDialog::directory() to return the same one which was previously set in setDirectory(). Task-number: QTBUG-35779 Change-Id: Iac1f88c770ff1ef06a7f884f9a42d72674c967ba Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
ffac6ee267
commit
e37616bbad
@ -1004,7 +1004,11 @@ void QFileDialog::setDirectory(const QString &directory)
|
||||
QDir QFileDialog::directory() const
|
||||
{
|
||||
Q_D(const QFileDialog);
|
||||
return QDir(d->nativeDialogInUse ? d->directory_sys().toLocalFile() : d->rootPath());
|
||||
if (d->nativeDialogInUse) {
|
||||
QString dir = d->directory_sys().toLocalFile();
|
||||
return QDir(dir.isEmpty() ? d->options->initialDirectory().toLocalFile() : dir);
|
||||
}
|
||||
return d->rootPath();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user