summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/utils.h
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2018-07-13 09:02:14 +0000
committerJarek Kobus <jaroslaw.kobus@qt.io>2018-07-19 12:38:45 +0000
commitff18b02f21a04f7092b58be04be5a40df3ef993b (patch)
tree66c268bc6bab9c38f27c682f0a3fd4093080da97 /src/tools/uic/utils.h
parent519fcb38a2b9e2c4490e8a3c740ad43227a71b77 (diff)
uic: Revert the microoptimization patch introducing QStringLiteral
This reverts the following commits: d12d2949d1e4ac08a47928ef27bc45459b3fb104 26c3bec09bccf9006f5ef4945a428d9ef56c1d12 49b08f96e824f49fab9aa5c9a1a0ed582d4558bb We can't easily predict all code paths for QDesigner with such a microoptimization. We also don't want to generate three different string constructions depending on some sophisticated heuristics. [ChangeLog][uic] The -no-stringliteral option is now deprecated and UIC will not generate QStringLiteral anymore. Task-number: QTBUG-65251 Task-number: QTBUG-51602 Change-Id: I34a5a1934a8df19c5c84ac2ba8e5168ce5665037 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools/uic/utils.h')
-rw-r--r--src/tools/uic/utils.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/tools/uic/utils.h b/src/tools/uic/utils.h
index 18b361fb81..1f8fd28639 100644
--- a/src/tools/uic/utils.h
+++ b/src/tools/uic/utils.h
@@ -42,27 +42,18 @@ inline bool toBool(const QString &str)
inline QString toString(const DomString *str)
{ return str ? str->text() : QString(); }
-enum StringFlags {
- Utf8String = 0x1,
- MultiLineString = 0x2
-};
-
-inline QString fixString(const QString &str, const QString &indent,
- unsigned *stringFlags = 0)
+inline QString fixString(const QString &str, const QString &indent)
{
QString cursegment;
QStringList result;
const QByteArray utf8 = str.toUtf8();
const int utf8Length = utf8.length();
- unsigned flags = 0;
-
for (int i = 0; i < utf8Length; ++i) {
const uchar cbyte = utf8.at(i);
if (cbyte >= 0x80) {
cursegment += QLatin1Char('\\');
cursegment += QString::number(cbyte, 8);
- flags |= Utf8String;
} else {
switch(cbyte) {
case '\\':
@@ -72,7 +63,6 @@ inline QString fixString(const QString &str, const QString &indent,
case '\r':
break;
case '\n':
- flags |= MultiLineString;
cursegment += QLatin1String("\\n\"\n\""); break;
default:
cursegment += QLatin1Char(cbyte);
@@ -98,12 +88,6 @@ inline QString fixString(const QString &str, const QString &indent,
rc += result.join(joinstr);
rc += QLatin1Char('"');
- if (result.size() > 1)
- flags |= MultiLineString;
-
- if (stringFlags)
- *stringFlags = flags;
-
return rc;
}