~3v1n0/ubuntu-ui-toolkit/slotslayout-paddings-changes-updates-size

« back to all changes in this revision

Viewing changes to src/UbuntuToolkit/ucstylehints.cpp

  • Committer: Tarmac
  • Author(s): Loïc Molinari
  • Date: 2016-09-20 06:24:44 UTC
  • mfrom: (2090.1.14 uitk-test)
  • Revision ID: tarmac-20160920062444-cjh9ih4lwzotqqbl
Optimised QString code gen for ASCII strings known at compile-time.

That allows the compiler to optimise our code better by putting all these QStrings known at compile time in the .rodata section of the binary as well as preventing a bunch of useless processing on them. That also allows us to remove "DEFINES -= QT_ASCII_CAST_WARNINGS" from the UbuntuToolkit pro file.

Approved by ubuntu-sdk-build-bot, Zsombor Egri.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
void UCStyleHintsParser::verifyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding)
37
37
{
38
38
    if (binding->type == QV4::CompiledData::Binding::Type_Object) {
39
 
        error(qmlUnit->objectAt(binding->value.objectIndex), "StyleHints does not support creating state-specific objects.");
 
39
        error(qmlUnit->objectAt(binding->value.objectIndex),
 
40
              QStringLiteral("StyleHints does not support creating state-specific objects."));
40
41
        return;
41
42
    }
42
43
 
52
53
 
53
54
    // filter out signals!
54
55
    QString propertyName = qmlUnit->stringAt(binding->propertyNameIndex);
55
 
    if (propertyName.startsWith("on") && propertyName.at(2).isUpper()) {
56
 
        error(binding, "Signal properties are not supported.");
 
56
    if (propertyName.startsWith(QStringLiteral("on")) && propertyName.at(2).isUpper()) {
 
57
        error(binding, QStringLiteral("Signal properties are not supported."));
57
58
        return;
58
59
    }
59
60
}
142
143
void UCStyleHints::propertyNotFound(const QString &styleName, const QString &property)
143
144
{
144
145
    if (!m_ignoreUnknownProperties) {
145
 
        qmlInfo(this) << QString("Style '%1' has no property called '%2'.").arg(styleName).arg(property);
 
146
        qmlInfo(this) << QStringLiteral("Style '%1' has no property called '%2'.").arg(styleName).arg(property);
146
147
    }
147
148
}
148
149