Skip to content
Permalink
Browse files

[spatialite] QRegEx -> QRegularExpression

  • Loading branch information
nirvn committed Apr 2, 2021
1 parent 6184726 commit f22eab1504253c9506ad0ba42f8f532cf7af518f
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -4990,13 +4990,13 @@ bool QgsSpatiaLiteProvider::checkLayerType()
// get a new alias for the subquery
int index = 0;
QString alias;
QRegExp regex;
QRegularExpression regex;
do
{
alias = QStringLiteral( "subQuery_%1" ).arg( QString::number( index++ ) );
QString pattern = QStringLiteral( "(\\\"?)%1\\1" ).arg( QRegExp::escape( alias ) );
QString pattern = QStringLiteral( "(\\\"?)%1\\1" ).arg( QRegularExpression::escape( alias ) );
regex.setPattern( pattern );
regex.setCaseSensitivity( Qt::CaseInsensitive );
regex.setPatternOptions( QRegularExpression::CaseInsensitiveOption );
}
while ( mQuery.contains( regex ) );

@@ -5045,7 +5045,7 @@ bool QgsSpatiaLiteProvider::checkLayerType()
// Check if the whole sql is aliased i.e. '(SELECT * FROM \\"somedata\\" as my_alias\n)'
if ( tableAlias.isEmpty() )
{
regex.setPattern( QStringLiteral( R"re(\s+AS\s+(\w+)\n?\)?$)re" ) );
re.setPattern( QStringLiteral( R"re(\s+AS\s+(\w+)\n?\)?$)re" ) );
match = re.match( mTableName );
if ( match.hasMatch() )
{

0 comments on commit f22eab1

Please sign in to comment.