Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/classification/qgsclassificationmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ void QgsClassificationMethod::setLabelPrecision( int precision )

QString QgsClassificationMethod::formatNumber( double value ) const
{
static const QRegularExpression RE_TRAILING_ZEROES = QRegularExpression( "[.,]?0*$" );
static const QRegularExpression RE_NEGATIVE_ZERO = QRegularExpression( "^\\-0(?:[.,]0*)?$" );
const thread_local QRegularExpression RE_TRAILING_ZEROES = QRegularExpression( "[.,]?0*$" );
const thread_local QRegularExpression RE_NEGATIVE_ZERO = QRegularExpression( "^\\-0(?:[.,]0*)?$" );
if ( mLabelPrecision > 0 )
{
QString valueStr = QLocale().toString( value, 'f', mLabelPrecision );
Expand Down
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ QString QgsExpression::replaceExpressionText( const QString &action, const QgsEx
int index = 0;
while ( index < action.size() )
{
static const QRegularExpression sRegEx { u"\\[%(.*?)%\\]"_s, QRegularExpression::MultilineOption | QRegularExpression::DotMatchesEverythingOption };
const thread_local QRegularExpression sRegEx { u"\\[%(.*?)%\\]"_s, QRegularExpression::MultilineOption | QRegularExpression::DotMatchesEverythingOption };

const QRegularExpressionMatch match = sRegEx.match( action, index );
if ( !match.hasMatch() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/network/qgsnewsfeedparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void QgsNewsFeedParser::fetchImageForEntry( const QgsNewsFeedParser::Entry &entr

QString QgsNewsFeedParser::keyForFeed( const QString &baseUrl )
{
static const QRegularExpression sRegexp( u"[^a-zA-Z0-9]"_s );
const thread_local QRegularExpression sRegexp( u"[^a-zA-Z0-9]"_s );
QString res = baseUrl;
res = res.replace( sRegexp, QString() );
return res;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ void QgsApplication::setUITheme( const QString &themeName )
{
// apply OS-specific UI scale factor to stylesheet's em values
int index = 0;
const static QRegularExpression regex( u"(?<=[\\s:])([0-9\\.]+)(?=em)"_s );
const thread_local QRegularExpression regex( u"(?<=[\\s:])([0-9\\.]+)(?=em)"_s );
QRegularExpressionMatch match = regex.match( styledata, index );
while ( match.hasMatch() )
{
Expand Down
12 changes: 3 additions & 9 deletions src/core/qgsstringutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,9 @@ QString QgsStringUtils::capitalize( const QString &string, Qgis::Capitalization
{
// yes, this is MASSIVELY simplifying the problem!!

static QStringList smallWords;
static QStringList newPhraseSeparators;
static QRegularExpression splitWords;
if ( smallWords.empty() )
{
smallWords = QObject::tr( "a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|s|the|to|vs.|vs|via" ).split( '|' );
newPhraseSeparators = QObject::tr( ".|:" ).split( '|' );
splitWords = QRegularExpression( u"\\b"_s, QRegularExpression::UseUnicodePropertiesOption );
}
const thread_local QStringList smallWords = QObject::tr( "a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|s|the|to|vs.|vs|via" ).split( '|' );
const thread_local QStringList newPhraseSeparators = QObject::tr( ".|:" ).split( '|' );
const thread_local QRegularExpression splitWords = QRegularExpression( u"\\b"_s, QRegularExpression::UseUnicodePropertiesOption );

const bool allSameCase = string.toLower() == string || string.toUpper() == string;
const QStringList parts = ( allSameCase ? string.toLower() : string ).split( splitWords, Qt::SkipEmptyParts );
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ QString QgsPostgresUtils::andWhereClauses( const QString &c1, const QString &c2

void QgsPostgresUtils::replaceInvalidXmlChars( QString &xml )
{
static const QRegularExpression replaceRe { u"([\\x00-\\x08\\x0B-\\x1F\\x7F])"_s };
const thread_local QRegularExpression replaceRe { u"([\\x00-\\x08\\x0B-\\x1F\\x7F])"_s };
QRegularExpressionMatchIterator it { replaceRe.globalMatch( xml ) };
while ( it.hasNext() )
{
Expand All @@ -330,7 +330,7 @@ void QgsPostgresUtils::replaceInvalidXmlChars( QString &xml )

void QgsPostgresUtils::restoreInvalidXmlChars( QString &xml )
{
static const QRegularExpression replaceRe { QStringLiteral( R"raw(UTF-8\[(\d+)\])raw" ) };
const thread_local QRegularExpression replaceRe { QStringLiteral( R"raw(UTF-8\[(\d+)\])raw" ) };
QRegularExpressionMatchIterator it { replaceRe.globalMatch( xml ) };
while ( it.hasNext() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ void QgsWmsProvider::createTileRequestsXYZ( const QgsWmtsTileMatrix *tm, const Q
QString turl( url );

// Add bbox placeholder resolution for WMS services using XYZ tiling with bbox parameters
static const QRegularExpression bboxRegex( R"(\{bbox-epsg-(\d+)\})", QRegularExpression::CaseInsensitiveOption );
const thread_local QRegularExpression bboxRegex( R"(\{bbox-epsg-(\d+)\})", QRegularExpression::CaseInsensitiveOption );
QRegularExpressionMatch bboxMatch = bboxRegex.match( turl );
if ( bboxMatch.hasMatch() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wfs3/qgswfs3handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2379,7 +2379,7 @@ void QgsWfs3CollectionsItemsHandler::handleRequest( const QgsServerApiContext &c
for ( auto it = attrFilters.constBegin(); it != attrFilters.constEnd(); it++ )
{
// Handle star
static const QRegularExpression re2( R"raw([^\\]\*)raw" );
const thread_local QRegularExpression re2( R"raw([^\\]\*)raw" );
if ( re2.match( it.value() ).hasMatch() )
{
QString val { it.value() };
Expand Down
Loading