Skip to content

Commit

Permalink
Use QRegularExpression and negative look behind
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jun 19, 2018
1 parent 24ed8d4 commit 941d1c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsmimedatautils.cpp
Expand Up @@ -207,12 +207,12 @@ QString QgsMimeDataUtils::encode( const QStringList &items )
{
QString encoded;
// Do not escape colon twice
QRegExp re( "([^\\\\]):" );
QRegularExpression re( "(?<!\\\\):" );
Q_FOREACH ( const QString &item, items )
{
QString str = item;
str.replace( '\\', QLatin1String( "\\\\" ) );
str.replace( re, QLatin1String( "\\1\\:" ) );
str.replace( re, QLatin1String( "\\:" ) );
encoded += str + ':';
}
return encoded.left( encoded.length() - 1 );
Expand Down

0 comments on commit 941d1c0

Please sign in to comment.