Skip to content
Permalink
Browse files

Add formats extensions/protocol already supported by GDAL/OGR.

This should fix bugs:

* #3799 on CouchDB support.
* #4362 on ovr and ovf for VRT files.
* #5242 on KMZ support.
* #6197 on SQLite file extensions support.
  • Loading branch information
Médéric RIBREUX
Médéric RIBREUX committed Dec 12, 2015
1 parent 62f90d0 commit 72c5e375a773835290d5da7200d3d0b18e8b1d09
@@ -197,6 +197,14 @@ QString createProtocolURI( const QString& type, const QString& url )
{
uri = url;
}
else if ( type == "CouchDB" )
{
uri = QString( "couchdb:%1" ).arg( url );
}
else if ( type == "DODS/OPeNDAP" )
{
uri = QString( "DODS:%1" ).arg( url );
}
QgsDebugMsg( "Connection type is=" + type + " and uri=" + uri );
return uri;
}
@@ -112,7 +112,7 @@ void QgsNewSpatialiteLayerDialog::on_toolButtonNewDatabase_clicked()
{
QString fileName = QFileDialog::getSaveFileName( this, tr( "New SpatiaLite Database File" ),
QDir::homePath(),
tr( "SpatiaLite" ) + " (*.sqlite *.db)" );
tr( "SpatiaLite" ) + " (*.sqlite *.db *.sqlite3 *.db3 *.s3db)" );

if ( fileName.isEmpty() )
return;
@@ -2086,6 +2086,11 @@ void buildSupportedRasterFileFilterAndExtensions( QString & theFileFiltersString
glob += " *.jpeg";
theExtensions << "jpeg";
}
else if ( myGdalDriverDescription == "VRT" )
{
glob += " *.ovr";
theExtensions << "ovr";
}

theFileFiltersString += createFileFilter_( myGdalDriverLongName, glob );

@@ -1701,6 +1701,10 @@ QString createFilters( QString type )
{
myProtocolDrivers += "DODS/OPeNDAP,DODS;";
}
else if ( driverName.startsWith( QObject::tr( "CouchDB" ) ) )
{
myProtocolDrivers += "CouchDB;";
}
else if ( driverName.startsWith( "FileGDB" ) )
{
myDirectoryDrivers += QObject::tr( "ESRI FileGDB" ) + ",FileGDB;";
@@ -1782,8 +1786,8 @@ QString createFilters( QString type )
}
else if ( driverName.startsWith( "KML" ) )
{
myFileFilters += createFileFilter_( QObject::tr( "Keyhole Markup Language [KML]" ), "*.kml" );
myExtensions << "kml";
myFileFilters += createFileFilter_( QObject::tr( "Keyhole Markup Language [KML]" ), "*.kml *.kmz" );
myExtensions << "kml" << "kmz";
}
else if ( driverName.startsWith( "MapInfo File" ) )
{
@@ -1842,8 +1846,8 @@ QString createFilters( QString type )
}
else if ( driverName.startsWith( "SQLite" ) )
{
myFileFilters += createFileFilter_( QObject::tr( "SQLite/SpatiaLite" ), "*.sqlite *.db" );
myExtensions << "sqlite" << "db";
myFileFilters += createFileFilter_( QObject::tr( "SQLite/SpatiaLite" ), "*.sqlite *.db *.sqlite3 *.db3 *.s3db *.sl3" );
myExtensions << "sqlite" << "db" << "sqlite3" << "db3" << "s3db" << "sl3";
}
else if ( driverName.startsWith( "SXF" ) )
{
@@ -1861,8 +1865,8 @@ QString createFilters( QString type )
else if ( driverName.startsWith( "VRT" ) )
{
myFileFilters += createFileFilter_( QObject::tr( "VRT - Virtual Datasource" ),
"*.vrt" );
myExtensions << "vrt";
"*.vrt *.ovf" );
myExtensions << "vrt" << "ovf";
}
else if ( driverName.startsWith( "XPlane" ) )
{
@@ -321,7 +321,7 @@ void QgsSLRootItem::createDatabase()

QString filename = QFileDialog::getSaveFileName( 0, tr( "New SpatiaLite Database File" ),
lastUsedDir,
tr( "SpatiaLite" ) + " (*.sqlite *.db)" );
tr( "SpatiaLite" ) + " (*.sqlite *.db *.sqlite3 *.db3 *.s3db)" );
if ( filename.isEmpty() )
return;

@@ -273,7 +273,7 @@ bool QgsSpatiaLiteSourceSelect::newConnection( QWidget* parent )

QString myFile = QFileDialog::getOpenFileName( parent,
tr( "Choose a SpatiaLite/SQLite DB to open" ),
lastUsedDir, tr( "SpatiaLite DB" ) + " (*.sqlite *.db);;" + tr( "All files" ) + " (*)" );
lastUsedDir, tr( "SpatiaLite DB" ) + " (*.sqlite *.db *.sqlite3 *.db3 *.s3db);;" + tr( "All files" ) + " (*)" );

if ( myFile.isEmpty() )
return false;

0 comments on commit 72c5e37

Please sign in to comment.
You can’t perform that action at this time.