Skip to content

Commit c5b3b1a

Browse files
committedJan 10, 2017
support escape syntax. $$qgis_version will be kept and $qgis_version
will be replaced with value
1 parent f77e677 commit c5b3b1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/gui/qgshelp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <QFileInfo>
2121
#include <QTcpSocket>
2222
#include <QDesktopServices>
23+
#include <QRegularExpression>
2324
#include <QNetworkProxy>
2425
#include <QNetworkProxyFactory>
2526

@@ -54,7 +55,8 @@ QUrl QgsHelp::helpUrl( const QString& key )
5455
fullPath = path;
5556
Q_FOREACH ( const QString& var, scope->variableNames() )
5657
{
57-
fullPath.replace( QStringLiteral( "$%1" ).arg( var ), scope->variable( var ).toString() );
58+
QRegularExpression rx( QStringLiteral( "(?<!\\$)\\$%1" ).arg( var ) );
59+
fullPath.replace( rx, scope->variable( var ).toString() );
5860
}
5961

6062
helpPath = QStringLiteral( "%1/%2" ).arg( fullPath ).arg( key );

0 commit comments

Comments
 (0)
Please sign in to comment.