mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-22 00:14:55 -05:00
Fix sublayer group name handling for sources which are directories
not files (e.g. .gdb databases) Fixes #44181
This commit is contained in:
parent
0dc48700fb
commit
cfbc2279a7
@ -99,14 +99,14 @@ QgsProviderSublayersDialog::QgsProviderSublayersDialog( const QString &uri, cons
|
||||
QgsGui::enableAutoGeometryRestore( this );
|
||||
|
||||
const QFileInfo fileInfo( filePath );
|
||||
mFilePath = fileInfo.isFile() && fileInfo.exists() ? filePath : QString();
|
||||
mFileName = !mFilePath.isEmpty() ? fileInfo.fileName() : QString();
|
||||
mFilePath = ( fileInfo.isFile() || fileInfo.isDir() ) && fileInfo.exists() ? filePath : QString();
|
||||
const QString fileName = !mFilePath.isEmpty() ? QgsProviderUtils::suggestLayerNameFromFilePath( mFilePath ) : QString();
|
||||
|
||||
setWindowTitle( mFileName.isEmpty() ? tr( "Select Items to Add" ) : QStringLiteral( "%1 | %2" ).arg( tr( "Select Items to Add" ), mFileName ) );
|
||||
setWindowTitle( fileName.isEmpty() ? tr( "Select Items to Add" ) : QStringLiteral( "%1 | %2" ).arg( tr( "Select Items to Add" ), fileName ) );
|
||||
|
||||
mLblFilePath->setText( QStringLiteral( "<a href=\"%1\">%2</a>" )
|
||||
.arg( QUrl::fromLocalFile( mFilePath ).toString(), QDir::toNativeSeparators( QFileInfo( mFilePath ).canonicalFilePath() ) ) );
|
||||
mLblFilePath->setVisible( !mFileName.isEmpty() );
|
||||
mLblFilePath->setVisible( !mFilePath.isEmpty() );
|
||||
mLblFilePath->setWordWrap( true );
|
||||
mLblFilePath->setTextInteractionFlags( Qt::TextBrowserInteraction );
|
||||
connect( mLblFilePath, &QLabel::linkActivated, this, [ = ]( const QString & link )
|
||||
|
||||
@ -78,7 +78,6 @@ class QgsProviderSublayersDialog : public QDialog, private Ui::QgsProviderSublay
|
||||
QgsProviderSublayerProxyModel *mProxyModel = nullptr;
|
||||
QPointer< QgsProviderSublayerTask > mTask;
|
||||
QString mFilePath;
|
||||
QString mFileName;
|
||||
bool mBlockSelectionChanges = false;
|
||||
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user