Changeset View
Changeset View
Standalone View
Standalone View
src/ExportManager.cpp
Context not available. | |||||
179 | title = mWindowTitle.replace(QLatin1Char('/'), QLatin1String("_")); // POSIX doesn't allow "/" in filenames | 179 | title = mWindowTitle.replace(QLatin1Char('/'), QLatin1String("_")); // POSIX doesn't allow "/" in filenames | ||
---|---|---|---|---|---|
180 | } else { | 180 | } else { | ||
181 | // Remove '%T' with separators around it | 181 | // Remove '%T' with separators around it | ||
182 | const auto wordSymbol = QStringLiteral(R"(\p{L}\p{M}\p{N})"); | 182 | // Separators are anything that isn't a unicode letter \p{L}, mark \p{M}, number \p{N} | ||
183 | // or the % character to avoid eating into a nearby pattern. | ||||
184 | const auto wordSymbol = QStringLiteral(R"(\p{L}\p{M}\p{N}%)"); | ||||
183 | const auto separator = QStringLiteral("([^%1]+)").arg(wordSymbol); | 185 | const auto separator = QStringLiteral("([^%1]+)").arg(wordSymbol); | ||
184 | const auto re = QRegularExpression(QStringLiteral("(.*?)(%1%T|%T%1)(.*?)").arg(separator)); | 186 | const auto re = QRegularExpression(QStringLiteral("(.*?)(%1%T|%T%1)(.*?)").arg(separator)); | ||
185 | baseName.replace(re, QStringLiteral(R"(\1\5)")); | 187 | baseName.replace(re, QStringLiteral(R"(\1\5)")); | ||
Context not available. |