Plugins: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434 Change-Id: If64c294033c114ae46dfc327c40da7f3c7a598f5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>bb10
parent
ceaa7d6341
commit
5ab4c9018f
|
|
@ -658,7 +658,7 @@ void QIBusPlatformInputContextPrivate::createBusProxy()
|
|||
const char* ibusService = usePortal ? "org.freedesktop.portal.IBus" : "org.freedesktop.IBus";
|
||||
QDBusReply<QDBusObjectPath> ic;
|
||||
if (usePortal) {
|
||||
portalBus = new QIBusProxyPortal(QLatin1String(ibusService),
|
||||
portalBus = new QIBusProxyPortal(QLatin1StringView(ibusService),
|
||||
"/org/freedesktop/IBus"_L1,
|
||||
*connection);
|
||||
if (!portalBus->isValid()) {
|
||||
|
|
@ -668,7 +668,7 @@ void QIBusPlatformInputContextPrivate::createBusProxy()
|
|||
|
||||
ic = portalBus->CreateInputContext("QIBusInputContext"_L1);
|
||||
} else {
|
||||
bus = new QIBusProxy(QLatin1String(ibusService),
|
||||
bus = new QIBusProxy(QLatin1StringView(ibusService),
|
||||
"/org/freedesktop/IBus"_L1,
|
||||
*connection);
|
||||
if (!bus->isValid()) {
|
||||
|
|
@ -688,7 +688,7 @@ void QIBusPlatformInputContextPrivate::createBusProxy()
|
|||
return;
|
||||
}
|
||||
|
||||
context = new QIBusInputContextProxy(QLatin1String(ibusService), ic.value().path(), *connection);
|
||||
context = new QIBusInputContextProxy(QLatin1StringView(ibusService), ic.value().path(), *connection);
|
||||
|
||||
if (!context->isValid()) {
|
||||
qWarning("QIBusPlatformInputContext: invalid input context.");
|
||||
|
|
@ -746,7 +746,7 @@ QString QIBusPlatformInputContextPrivate::getSocketPath()
|
|||
|
||||
return QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) +
|
||||
"/ibus/bus/"_L1 +
|
||||
QLatin1String(QDBusConnection::localMachineId()) +
|
||||
QLatin1StringView(QDBusConnection::localMachineId()) +
|
||||
u'-' + QString::fromLocal8Bit(host) + u'-' + QString::fromLocal8Bit(displayNumber);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ bool shouldBeIgnored(QAccessibleInterface *interface)
|
|||
return true;
|
||||
|
||||
if (QObject * const object = interface->object()) {
|
||||
const QString className = QLatin1String(object->metaObject()->className());
|
||||
const QString className = QLatin1StringView(object->metaObject()->className());
|
||||
|
||||
// VoiceOver focusing on tool tips can be confusing. The contents of the
|
||||
// tool tip is available through the description attribute anyway, so
|
||||
|
|
|
|||
|
|
@ -401,12 +401,12 @@ QCocoaDrag *QCocoaIntegration::drag() const
|
|||
|
||||
QStringList QCocoaIntegration::themeNames() const
|
||||
{
|
||||
return QStringList(QLatin1String(QCocoaTheme::name));
|
||||
return QStringList(QLatin1StringView(QCocoaTheme::name));
|
||||
}
|
||||
|
||||
QPlatformTheme *QCocoaIntegration::createPlatformTheme(const QString &name) const
|
||||
{
|
||||
if (name == QLatin1String(QCocoaTheme::name))
|
||||
if (name == QLatin1StringView(QCocoaTheme::name))
|
||||
return new QCocoaTheme;
|
||||
return QPlatformIntegration::createPlatformTheme(name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ Q_LOGGING_CATEGORY(lcCocoaNotifications, "qt.qpa.cocoa.notifications");
|
|||
|
||||
static void qRegisterNotificationCallbacks()
|
||||
{
|
||||
static const QLatin1String notificationHandlerPrefix(Q_NOTIFICATION_PREFIX);
|
||||
static const QLatin1StringView notificationHandlerPrefix(Q_NOTIFICATION_PREFIX);
|
||||
|
||||
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
|
||||
|
||||
|
|
|
|||
|
|
@ -1036,7 +1036,7 @@ public:
|
|||
// Get substitute name
|
||||
static const char keyC[] = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes";
|
||||
const QString familyName = QString::fromWCharArray(lf.lfFaceName);
|
||||
const QString nameSubstitute = QSettings(QLatin1String(keyC), QSettings::NativeFormat).value(familyName, familyName).toString();
|
||||
const QString nameSubstitute = QSettings(QLatin1StringView(keyC), QSettings::NativeFormat).value(familyName, familyName).toString();
|
||||
if (nameSubstitute != familyName) {
|
||||
const int nameSubstituteLength = qMin(nameSubstitute.length(), LF_FACESIZE - 1);
|
||||
memcpy(lf.lfFaceName, nameSubstitute.data(), size_t(nameSubstituteLength) * sizeof(wchar_t));
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ QKmsDevice *QEglFSKmsEglDeviceIntegration::createDevice()
|
|||
if (Q_UNLIKELY(!deviceName))
|
||||
qFatal("Failed to query device name from EGLDevice");
|
||||
|
||||
return new QEglFSKmsEglDevice(this, screenConfig(), QLatin1String(deviceName));
|
||||
return new QEglFSKmsEglDevice(this, screenConfig(), QLatin1StringView(deviceName));
|
||||
}
|
||||
|
||||
bool QEglFSKmsEglDeviceIntegration::query_egl_device()
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ QMimeData *QHaikuClipboard::mimeData(QClipboard::Mode mode)
|
|||
|
||||
const status_t status = clipboard->FindData(name, B_MIME_TYPE, &data, &dataLen);
|
||||
if (dataLen && (status == B_OK)) {
|
||||
const QLatin1String format(name);
|
||||
const QLatin1StringView format(name);
|
||||
if (format == "text/plain"_L1) {
|
||||
m_systemMimeData->setText(QString::fromLocal8Bit(reinterpret_cast<const char*>(data), dataLen));
|
||||
} else if (format == "text/html"_L1) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class QIOSFileEngineFactory : public QAbstractFileEngineHandler
|
|||
public:
|
||||
QAbstractFileEngine* create(const QString &fileName) const
|
||||
{
|
||||
static QLatin1String assetsScheme("assets-library:");
|
||||
static QLatin1StringView assetsScheme("assets-library:");
|
||||
|
||||
#ifndef Q_OS_TVOS
|
||||
if (fileName.toLower().startsWith(assetsScheme))
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ QSurfaceFormat QIOSContext::format() const
|
|||
return m_format;
|
||||
}
|
||||
|
||||
#define QT_IOS_GL_STATUS_CASE(val) case val: return QLatin1String(#val)
|
||||
#define QT_IOS_GL_STATUS_CASE(val) case val: return QLatin1StringView(#val)
|
||||
|
||||
static QString fboStatusString(GLenum status)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -267,12 +267,12 @@ QVariant QIOSIntegration::styleHint(StyleHint hint) const
|
|||
|
||||
QStringList QIOSIntegration::themeNames() const
|
||||
{
|
||||
return QStringList(QLatin1String(QIOSTheme::name));
|
||||
return QStringList(QLatin1StringView(QIOSTheme::name));
|
||||
}
|
||||
|
||||
QPlatformTheme *QIOSIntegration::createPlatformTheme(const QString &name) const
|
||||
{
|
||||
if (name == QLatin1String(QIOSTheme::name))
|
||||
if (name == QLatin1StringView(QIOSTheme::name))
|
||||
return new QIOSTheme;
|
||||
|
||||
return QPlatformIntegration::createPlatformTheme(name);
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ QUrl QWindowsShellItem::url() const
|
|||
return urlV;
|
||||
// Last resort: encode the absolute desktop parsing id as data URL
|
||||
const QString data = QStringLiteral("data:text/plain;base64,")
|
||||
+ QLatin1String(desktopAbsoluteParsing().toLatin1().toBase64());
|
||||
+ QLatin1StringView(desktopAbsoluteParsing().toLatin1().toBase64());
|
||||
return QUrl(data);
|
||||
}
|
||||
|
||||
|
|
@ -675,7 +675,7 @@ bool QWindowsShellItem::copyData(QIODevice *out, QString *errorMessage)
|
|||
HRESULT hr = m_item->BindToHandler(nullptr, BHID_Stream, IID_PPV_ARGS(&istream));
|
||||
if (FAILED(hr)) {
|
||||
*errorMessage = "BindToHandler() failed: "_L1
|
||||
+ QLatin1String(QWindowsContext::comErrorString(hr));
|
||||
+ QLatin1StringView(QWindowsContext::comErrorString(hr));
|
||||
return false;
|
||||
}
|
||||
enum : ULONG { bufSize = 102400 };
|
||||
|
|
@ -692,7 +692,7 @@ bool QWindowsShellItem::copyData(QIODevice *out, QString *errorMessage)
|
|||
istream->Release();
|
||||
if (hr != S_OK && hr != S_FALSE) {
|
||||
*errorMessage = "Read() failed: "_L1
|
||||
+ QLatin1String(QWindowsContext::comErrorString(hr));
|
||||
+ QLatin1StringView(QWindowsContext::comErrorString(hr));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ struct QWindowsIntegrationPrivate
|
|||
};
|
||||
|
||||
template <typename IntType>
|
||||
bool parseIntOption(const QString ¶meter,const QLatin1String &option,
|
||||
bool parseIntOption(const QString ¶meter,const QLatin1StringView &option,
|
||||
IntType minimumValue, IntType maximumValue, IntType *target)
|
||||
{
|
||||
const int valueLength = parameter.size() - option.size() - 1;
|
||||
|
|
@ -643,12 +643,12 @@ QAbstractEventDispatcher * QWindowsIntegration::createEventDispatcher() const
|
|||
|
||||
QStringList QWindowsIntegration::themeNames() const
|
||||
{
|
||||
return QStringList(QLatin1String(QWindowsTheme::name));
|
||||
return QStringList(QLatin1StringView(QWindowsTheme::name));
|
||||
}
|
||||
|
||||
QPlatformTheme *QWindowsIntegration::createPlatformTheme(const QString &name) const
|
||||
{
|
||||
if (name == QLatin1String(QWindowsTheme::name))
|
||||
if (name == QLatin1StringView(QWindowsTheme::name))
|
||||
return new QWindowsTheme;
|
||||
return QPlatformIntegration::createPlatformTheme(name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1264,7 +1264,7 @@ static const char x_qt_windows_mime[] = "application/x-qt-windows-mime;value=\""
|
|||
|
||||
static bool isCustomMimeType(const QString &mimeType)
|
||||
{
|
||||
return mimeType.startsWith(QLatin1String(x_qt_windows_mime), Qt::CaseInsensitive);
|
||||
return mimeType.startsWith(QLatin1StringView(x_qt_windows_mime), Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
static QString customMimeType(const QString &mimeType, int *lindex = nullptr)
|
||||
|
|
@ -1346,7 +1346,7 @@ QString QLastResortMimes::mimeForFormat(const FORMATETC &formatetc) const
|
|||
}
|
||||
}
|
||||
if (!ianaType)
|
||||
format = QLatin1String(x_qt_windows_mime) + clipFormat + u'"';
|
||||
format = QLatin1StringView(x_qt_windows_mime) + clipFormat + u'"';
|
||||
else
|
||||
format = clipFormat;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,13 +218,13 @@ QVariant GpuDescription::toVariant() const
|
|||
result.insert(QStringLiteral("deviceId"), QVariant(deviceId));
|
||||
result.insert(QStringLiteral("subSysId"),QVariant(subSysId));
|
||||
result.insert(QStringLiteral("revision"), QVariant(revision));
|
||||
result.insert(QStringLiteral("driver"), QVariant(QLatin1String(driverName)));
|
||||
result.insert(QStringLiteral("driver"), QVariant(QLatin1StringView(driverName)));
|
||||
result.insert(QStringLiteral("driverProduct"), QVariant(driverVersion.segmentAt(0)));
|
||||
result.insert(QStringLiteral("driverVersion"), QVariant(driverVersion.segmentAt(1)));
|
||||
result.insert(QStringLiteral("driverSubVersion"), QVariant(driverVersion.segmentAt(2)));
|
||||
result.insert(QStringLiteral("driverBuild"), QVariant(driverVersion.segmentAt(3)));
|
||||
result.insert(QStringLiteral("driverVersionString"), driverVersion.toString());
|
||||
result.insert(QStringLiteral("description"), QVariant(QLatin1String(description)));
|
||||
result.insert(QStringLiteral("description"), QVariant(QLatin1StringView(description)));
|
||||
result.insert(QStringLiteral("printable"), QVariant(toString()));
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ static inline QString mailCommand()
|
|||
// Check if user has set preference, otherwise use default.
|
||||
QString keyName = QWinRegistryKey(HKEY_CURRENT_USER, mailUserKey)
|
||||
.stringValue( L"Progid");
|
||||
const auto mailto = keyName.isEmpty() ? "mailto"_L1 : QLatin1String();
|
||||
const auto mailto = keyName.isEmpty() ? "mailto"_L1 : QLatin1StringView();
|
||||
keyName += mailto + "\\Shell\\Open\\Command"_L1;
|
||||
if (debug)
|
||||
qDebug() << __FUNCTION__ << "keyName=" << keyName;
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ HRESULT QWindowsUiaMainProvider::GetPropertyValue(PROPERTYID idProp, VARIANT *pR
|
|||
case UIA_ClassNamePropertyId:
|
||||
// Class name.
|
||||
if (QObject *o = accessible->object()) {
|
||||
QString className = QLatin1String(o->metaObject()->className());
|
||||
QString className = QLatin1StringView(o->metaObject()->className());
|
||||
setVariantString(className, pRetVal);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1330,14 +1330,14 @@ QVariant QXcbDropData::xdndObtainData(const QByteArray &format, QMetaType reques
|
|||
QXcbWindow *xcb_window = c->platformWindowFromId(drag->xdnd_dragsource);
|
||||
if (xcb_window && drag->currentDrag() && xcb_window->window()->type() != Qt::Desktop) {
|
||||
QMimeData *data = drag->currentDrag()->mimeData();
|
||||
if (data->hasFormat(QLatin1String(format)))
|
||||
result = data->data(QLatin1String(format));
|
||||
if (data->hasFormat(QLatin1StringView(format)))
|
||||
result = data->data(QLatin1StringView(format));
|
||||
return result;
|
||||
}
|
||||
|
||||
QList<xcb_atom_t> atoms = drag->xdnd_types;
|
||||
bool hasUtf8 = false;
|
||||
xcb_atom_t a = mimeAtomForFormat(c, QLatin1String(format), requestedType, atoms, &hasUtf8);
|
||||
xcb_atom_t a = mimeAtomForFormat(c, QLatin1StringView(format), requestedType, atoms, &hasUtf8);
|
||||
if (a == XCB_NONE)
|
||||
return result;
|
||||
|
||||
|
|
@ -1349,7 +1349,7 @@ QVariant QXcbDropData::xdndObtainData(const QByteArray &format, QMetaType reques
|
|||
result = c->clipboard()->getSelection(xdnd_selection, a, xdnd_selection, drag->targetTime());
|
||||
#endif
|
||||
|
||||
return mimeConvertToFormat(c, a, result, QLatin1String(format), requestedType, hasUtf8);
|
||||
return mimeConvertToFormat(c, a, result, QLatin1StringView(format), requestedType, hasUtf8);
|
||||
}
|
||||
|
||||
bool QXcbDropData::hasFormat_sys(const QString &format) const
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa
|
|||
// so QXcbConnection::atomName() has to be used.
|
||||
if (atomName == "text/uri-list"_L1
|
||||
&& connection->atomName(a) == "text/x-moz-url") {
|
||||
const QString mozUri = QLatin1String(data->split('\n').constFirst()) + u'\n';
|
||||
const QString mozUri = QLatin1StringView(data->split('\n').constFirst()) + u'\n';
|
||||
*data = QByteArray(reinterpret_cast<const char *>(mozUri.data()),
|
||||
mozUri.length() * 2);
|
||||
} else if (atomName == "application/x-color"_L1)
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public:
|
|||
|
||||
static bool isTrayIconWindow(QWindow *window)
|
||||
{
|
||||
return window->objectName() == QLatin1String("QSystemTrayIconSysWindow");
|
||||
return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow");
|
||||
}
|
||||
|
||||
virtual void create();
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
QPlatformTheme *QGtk3ThemePlugin::create(const QString &key, const QStringList ¶ms)
|
||||
{
|
||||
Q_UNUSED(params);
|
||||
if (!key.compare(QLatin1String(QGtk3Theme::name), Qt::CaseInsensitive))
|
||||
if (!key.compare(QLatin1StringView(QGtk3Theme::name), Qt::CaseInsensitive))
|
||||
return new QGtk3Theme;
|
||||
|
||||
return nullptr;
|
||||
|
|
|
|||
Loading…
Reference in New Issue