File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -176,27 +176,13 @@ QString QgsHandleBadLayers::filename( int row )
176
176
177
177
if ( type == QLatin1String ( " vector" ) )
178
178
{
179
- if ( provider == QLatin1String ( " spatialite" ) )
180
- {
181
- QgsDataSourceUri uri ( datasource );
182
- return uri.database ();
183
- }
184
- else if ( provider == QLatin1String ( " ogr" ) )
185
- {
186
- QStringList theURIParts = datasource.split ( ' |' );
187
- return theURIParts[0 ];
188
- }
189
- else if ( provider == QLatin1String ( " delimitedtext" ) )
190
- {
191
- return QUrl::fromEncoded ( datasource.toLatin1 () ).toLocalFile ();
192
- }
179
+ const QVariantMap parts = QgsProviderRegistry::instance ()->decodeUri ( provider, datasource );
180
+ return parts.value ( QLatin1String ( " path" ) ).toString ();
193
181
}
194
182
else
195
183
{
196
184
return datasource;
197
185
}
198
-
199
- return QString ();
200
186
}
201
187
202
188
void QgsHandleBadLayers::setFilename ( int row, const QString &filename )
You can’t perform that action at this time.
0 commit comments