QtGui: Fix mismatches between string types and string literals

This commit addresses some comments from the review of QTBUG-98434.

Some strings were initialized with incorrect literal types - fix the
mismatches between the string types and string literals.

Task-number: QTBUG-103100
Change-Id: I5f9f8a2c1583c21711f7b9ff177917f20690b5a3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Mate Barany 2022-09-15 16:08:08 +02:00
parent 6f12603cb1
commit ec19ced731
6 changed files with 30 additions and 30 deletions

View File

@ -1551,7 +1551,7 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface)
{
QStringList ifaces;
qCDebug(lcAccessibilityAtspiCreation) << "AtSpiAdaptor::accessibleInterfaces create: " << interface->object();
ifaces << ATSPI_DBUS_INTERFACE_ACCESSIBLE ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_ACCESSIBLE ""_s;
if ( (!interface->rect().isEmpty()) ||
(interface->object() && interface->object()->isWidgetType()) ||
@ -1561,30 +1561,30 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface)
(interface->role() == QAccessible::Row) ||
(interface->object() && interface->object()->inherits("QSGItem"))
) {
ifaces << ATSPI_DBUS_INTERFACE_COMPONENT ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_COMPONENT ""_s;
} else {
qCDebug(lcAccessibilityAtspiCreation) << " IS NOT a component";
}
if (interface->role() == QAccessible::Application)
ifaces << ATSPI_DBUS_INTERFACE_APPLICATION ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_APPLICATION ""_s;
if (interface->actionInterface() || interface->valueInterface())
ifaces << ATSPI_DBUS_INTERFACE_ACTION ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_ACTION ""_s;
if (interface->textInterface())
ifaces << ATSPI_DBUS_INTERFACE_TEXT ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_TEXT ""_s;
if (interface->editableTextInterface())
ifaces << ATSPI_DBUS_INTERFACE_EDITABLE_TEXT ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_EDITABLE_TEXT ""_s;
if (interface->valueInterface())
ifaces << ATSPI_DBUS_INTERFACE_VALUE ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_VALUE ""_s;
if (interface->tableInterface())
ifaces << ATSPI_DBUS_INTERFACE_TABLE ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_TABLE ""_s;
if (interface->tableCellInterface())
ifaces << ATSPI_DBUS_INTERFACE_TABLE_CELL ""_L1;
ifaces << u"" ATSPI_DBUS_INTERFACE_TABLE_CELL ""_s;
return ifaces;
}
@ -1631,9 +1631,9 @@ QString AtSpiAdaptor::pathForObject(QObject *object) const
QString AtSpiAdaptor::pathForInterface(QAccessibleInterface *interface) const
{
if (!interface || !interface->isValid())
return ATSPI_DBUS_PATH_NULL ""_L1;
return u"" ATSPI_DBUS_PATH_NULL ""_s;
if (interface->role() == QAccessible::Application)
return QSPI_OBJECT_PATH_ROOT ""_L1;
return u"" QSPI_OBJECT_PATH_ROOT ""_s;
QAccessible::Id id = QAccessible::uniqueId(interface);
Q_ASSERT((int)id < 0);

View File

@ -1828,13 +1828,13 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
QStringList stateStrings;
QAccessible::State st = iface->state();
if (st.focusable)
stateStrings << "focusable"_L1;
stateStrings << u"focusable"_s;
if (st.focused)
stateStrings << "focused"_L1;
stateStrings << u"focused"_s;
if (st.selected)
stateStrings << "selected"_L1;
stateStrings << u"selected"_s;
if (st.invisible)
stateStrings << "invisible"_L1;
stateStrings << u"invisible"_s;
if (!stateStrings.isEmpty())
d << stateStrings.join(u'|');

View File

@ -772,7 +772,7 @@ QPixmap QIconLoaderEngine::pixmap(const QSize &size, QIcon::Mode mode,
QString QIconLoaderEngine::key() const
{
return "QIconLoaderEngine"_L1;
return u"QIconLoaderEngine"_s;
}
QString QIconLoaderEngine::iconName()

View File

@ -1074,20 +1074,20 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
*gmodifs << QModifKeyName(Qt::META, QChar(kControlUnicode));
*gmodifs << QModifKeyName(Qt::SHIFT, QChar(kShiftUnicode));
#endif
*gmodifs << QModifKeyName(Qt::CTRL, "ctrl+"_L1)
<< QModifKeyName(Qt::SHIFT, "shift+"_L1)
<< QModifKeyName(Qt::ALT, "alt+"_L1)
<< QModifKeyName(Qt::META, "meta+"_L1)
<< QModifKeyName(Qt::KeypadModifier, "num+"_L1);
*gmodifs << QModifKeyName(Qt::CTRL, u"ctrl+"_s)
<< QModifKeyName(Qt::SHIFT, u"shift+"_s)
<< QModifKeyName(Qt::ALT, u"alt+"_s)
<< QModifKeyName(Qt::META, u"meta+"_s)
<< QModifKeyName(Qt::KeypadModifier, u"num+"_s);
}
} else {
gmodifs = globalPortableModifs();
if (gmodifs->isEmpty()) {
*gmodifs << QModifKeyName(Qt::CTRL, "ctrl+"_L1)
<< QModifKeyName(Qt::SHIFT, "shift+"_L1)
<< QModifKeyName(Qt::ALT, "alt+"_L1)
<< QModifKeyName(Qt::META, "meta+"_L1)
<< QModifKeyName(Qt::KeypadModifier, "num+"_L1);
*gmodifs << QModifKeyName(Qt::CTRL, u"ctrl+"_s)
<< QModifKeyName(Qt::SHIFT, u"shift+"_s)
<< QModifKeyName(Qt::ALT, u"alt+"_s)
<< QModifKeyName(Qt::META, u"meta+"_s)
<< QModifKeyName(Qt::KeypadModifier, u"num+"_s);
}
}

View File

@ -235,13 +235,13 @@ public:
QString QMacPasteboardMimeTypeName::convertorName()
{
return "Qt-Mime-Type"_L1;
return u"Qt-Mime-Type"_s;
}
QString QMacPasteboardMimeTypeName::flavorFor(const QString &mime)
{
if (mime == "application/x-qt-mime-type-name"_L1)
return "com.trolltech.qt.MimeTypeName"_L1;
return u"com.trolltech.qt.MimeTypeName"_s;
return QString();
}

View File

@ -145,7 +145,7 @@ QString QTextList::itemText(const QTextBlock &blockIt) const
const int style = format().style();
QString numberPrefix;
QString numberSuffix = "."_L1;
QString numberSuffix = u"."_s;
if (format().hasProperty(QTextFormat::ListNumberPrefix))
numberPrefix = format().numberPrefix();
@ -214,7 +214,7 @@ QString QTextList::itemText(const QTextBlock &blockIt) const
result = QString::fromLatin1(romanNumeral);
}
else {
result = "?"_L1;
result = u"?"_s;
}
}