Windows QPA: Restrict file dialog to file system items in Directory mode
Qt cannot handle places like 'Network', etc. Task-number: QTBUG-63645 Change-Id: I53d0eedc2996af6a1ec3230e3d65a3e272aa3710 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>bb10
parent
851c226247
commit
d366d6dfd3
|
|
@ -1010,7 +1010,9 @@ void QWindowsNativeFileDialogBase::setMode(QFileDialogOptions::FileMode mode,
|
|||
break;
|
||||
case QFileDialogOptions::Directory:
|
||||
case QFileDialogOptions::DirectoryOnly:
|
||||
flags |= FOS_PICKFOLDERS | FOS_FILEMUSTEXIST;
|
||||
// QTBUG-63645: Restrict to file system items, as Qt cannot deal with
|
||||
// places like 'Network', etc.
|
||||
flags |= FOS_PICKFOLDERS | FOS_FILEMUSTEXIST | FOS_FORCEFILESYSTEM;
|
||||
break;
|
||||
case QFileDialogOptions::ExistingFiles:
|
||||
flags |= FOS_FILEMUSTEXIST | FOS_ALLOWMULTISELECT;
|
||||
|
|
@ -1219,6 +1221,8 @@ void QWindowsNativeFileDialogBase::onSelectionChange()
|
|||
{
|
||||
const QList<QUrl> current = selectedFiles();
|
||||
m_data.setSelectedFiles(current);
|
||||
qDebug() << __FUNCTION__ << current << current.size();
|
||||
|
||||
if (current.size() == 1)
|
||||
emit currentChanged(current.front());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue