From 736a5034de9f3a78631087e3edd7cbd192a22824 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 23 Jan 2025 11:19:54 +0100 Subject: [PATCH] improve --- src/dialogs/QskDialog.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dialogs/QskDialog.cpp b/src/dialogs/QskDialog.cpp index a46de3f3..02d883f9 100644 --- a/src/dialogs/QskDialog.cpp +++ b/src/dialogs/QskDialog.cpp @@ -272,14 +272,15 @@ namespace QObject::connect( m_model, &QFileSystemModel::directoryLoaded, this, &FileSelectionWindow< W >::loadContents ); - QObject::connect( m_model, &QFileSystemModel::rootPathChanged, - this, &FileSelectionWindow< W >::loadContents ); - QObject::connect( m_listBox, &QskSimpleListBox::selectedEntryChanged, this, [this]( const QString& path ) { QFileInfo fi( m_model->rootPath(), path ); - m_model->setRootPath( fi.absoluteFilePath() ); + + if( fi.isDir() ) + { + m_model->setRootPath( fi.absoluteFilePath() ); + } }); }