Skip to content
Permalink
Browse files

Use QRegularExpression and negative look behind

  • Loading branch information
elpaso committed Jun 19, 2018
1 parent 24ed8d4 commit 941d1c0677f17e8cfe0c06225d49e70608bc8171
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsmimedatautils.cpp
@@ -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 );

0 comments on commit 941d1c0

Please sign in to comment.
You can’t perform that action at this time.