"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gui/providers/ogr/qgsgeopackageitemguiprovider.cpp" between
QGIS-final-3_10_11.tar.gz and QGIS-final-3_10_12.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Long-term release (3.10.x series).

qgsgeopackageitemguiprovider.cpp  (QGIS-final-3_10_11):qgsgeopackageitemguiprovider.cpp  (QGIS-final-3_10_12)
skipping to change at line 286 skipping to change at line 286
return false; return false;
} }
void QgsGeoPackageItemGuiProvider::renameVectorLayer() void QgsGeoPackageItemGuiProvider::renameVectorLayer()
{ {
QAction *s = qobject_cast<QAction *>( sender() ); QAction *s = qobject_cast<QAction *>( sender() );
QVariantMap data = s->data().toMap(); QVariantMap data = s->data().toMap();
const QString uri = data[QStringLiteral( "uri" )].toString(); const QString uri = data[QStringLiteral( "uri" )].toString();
const QString key = data[QStringLiteral( "key" )].toString(); const QString key = data[QStringLiteral( "key" )].toString();
// Collect existing table names
const QStringList tableNames = data[QStringLiteral( "tableNames" )].toStringLi st(); const QStringList tableNames = data[QStringLiteral( "tableNames" )].toStringLi st();
QPointer< QgsDataItem > item = data[QStringLiteral( "item" )].value<QPointer< QgsDataItem >>(); QPointer< QgsDataItem > item = data[QStringLiteral( "item" )].value<QPointer< QgsDataItem >>();
QgsDataItemGuiContext context = data[QStringLiteral( "context" )].value< QgsDa taItemGuiContext >(); QgsDataItemGuiContext context = data[QStringLiteral( "context" )].value< QgsDa taItemGuiContext >();
// Get layer name from layer URI // Get layer name from layer URI
QVariantMap pieces( QgsProviderRegistry::instance()->decodeUri( key, uri ) ); QVariantMap pieces( QgsProviderRegistry::instance()->decodeUri( key, uri ) );
QString layerName = pieces[QStringLiteral( "layerName" )].toString(); QString layerName = pieces[QStringLiteral( "layerName" )].toString();
// Collect existing table names // Allow any character, except |, which could create confusion, due to it bein
const QRegExp checkRe( QStringLiteral( R"re([A-Za-z_][A-Za-z0-9_\s]+)re" ) ); g
// the URI componenent separator. And ideally we should remove that restrictio
n
// by using proper escaping of |
const QRegExp checkRe( QStringLiteral( R"re([^|]+)re" ) );
QgsNewNameDialog dlg( uri, layerName, QStringList(), tableNames, checkRe ); QgsNewNameDialog dlg( uri, layerName, QStringList(), tableNames, checkRe );
dlg.setOverwriteEnabled( false ); dlg.setOverwriteEnabled( false );
if ( dlg.exec() != dlg.Accepted || dlg.name().isEmpty() || dlg.name() == layer Name ) if ( dlg.exec() != dlg.Accepted || dlg.name().isEmpty() || dlg.name() == layer Name )
return; return;
rename( item, dlg.name(), context ); rename( item, dlg.name(), context );
} }
bool QgsGeoPackageItemGuiProvider::deleteLayer( QgsLayerItem *layerItem, QgsData ItemGuiContext ) bool QgsGeoPackageItemGuiProvider::deleteLayer( QgsLayerItem *layerItem, QgsData ItemGuiContext )
 End of changes. 2 change blocks. 
2 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)