mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add VirtualFileDialog fall back if initial directory is invalid
This commit is contained in:
@@ -590,9 +590,16 @@ VirtualFileDialog::VirtualFileDialog(ICaptureContext &ctx, QString initialDirect
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(false);
|
||||
|
||||
QModelIndex index;
|
||||
|
||||
if(!initialDirectory.isEmpty())
|
||||
index = m_Model->indexForPath(initialDirectory);
|
||||
|
||||
if(!index.isValid())
|
||||
index = m_Model->homeFolder();
|
||||
|
||||
// switch to home folder and expand it
|
||||
changeCurrentDir(initialDirectory.isEmpty() ? m_Model->homeFolder()
|
||||
: m_Model->indexForPath(initialDirectory));
|
||||
changeCurrentDir(index);
|
||||
ui->dirList->expand(m_DirProxy->mapFromSource(currentDir()));
|
||||
|
||||
QObject::connect(ui->fileList->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
||||
|
||||
Reference in New Issue
Block a user