Don't use QStringLiteral in comparisons
For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
bf1df55846
commit
1a5c0b26d0
@ -196,7 +196,7 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc
|
||||
min = rex.cap(5).toInt();
|
||||
sec = rex.cap(6).toInt();
|
||||
}
|
||||
positiveOffset = (rex.cap(7) == QStringLiteral("+"));
|
||||
positiveOffset = (rex.cap(7) == QLatin1String("+"));
|
||||
hourOffset = rex.cap(8).toInt();
|
||||
minOffset = rex.cap(9).toInt();
|
||||
}
|
||||
@ -217,7 +217,7 @@ static void rfcDateImpl(const QString &s, QDate *dd = 0, QTime *dt = 0, int *utc
|
||||
min = rex.cap(4).toInt();
|
||||
sec = rex.cap(5).toInt();
|
||||
}
|
||||
positiveOffset = (rex.cap(7) == QStringLiteral("+"));
|
||||
positiveOffset = (rex.cap(7) == QLatin1String("+"));
|
||||
hourOffset = rex.cap(8).toInt();
|
||||
minOffset = rex.cap(9).toInt();
|
||||
}
|
||||
|
@ -935,7 +935,7 @@ QDataStream &operator>>(QDataStream &ds, QTimeZone &tz)
|
||||
{
|
||||
QString ianaId;
|
||||
ds >> ianaId;
|
||||
if (ianaId == QStringLiteral("OffsetFromUtc")) {
|
||||
if (ianaId == QLatin1String("OffsetFromUtc")) {
|
||||
int utcOffset;
|
||||
QString name;
|
||||
QString abbreviation;
|
||||
|
@ -940,9 +940,9 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
|
||||
QString line;
|
||||
while (ianaId.isEmpty() && !ts.atEnd() && ts.status() == QTextStream::Ok) {
|
||||
line = ts.readLine();
|
||||
if (line.left(5) == QStringLiteral("ZONE=")) {
|
||||
if (line.startsWith(QLatin1String("ZONE="))) {
|
||||
ianaId = line.mid(6, line.size() - 7).toUtf8();
|
||||
} else if (line.left(9) == QStringLiteral("TIMEZONE=")) {
|
||||
} else if (line.startsWith(QLatin1String("TIMEZONE="))) {
|
||||
ianaId = line.mid(10, line.size() - 11).toUtf8();
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ bool QDesktopServices::openUrl(const QUrl &url)
|
||||
qWarning("%s: The platform plugin does not support services.", Q_FUNC_INFO);
|
||||
return false;
|
||||
}
|
||||
return url.scheme() == QStringLiteral("file") ?
|
||||
return url.scheme() == QLatin1String("file") ?
|
||||
platformServices->openDocument(url) : platformServices->openUrl(url);
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ void QCoreTextFontDatabase::populateFontDatabase()
|
||||
QString familyName = QCFString::toQString(familyNameRef);
|
||||
|
||||
// Don't populate internal fonts
|
||||
if (familyName.startsWith(QLatin1Char('.')) || familyName == QStringLiteral("LastResort"))
|
||||
if (familyName.startsWith(QLatin1Char('.')) || familyName == QLatin1String("LastResort"))
|
||||
continue;
|
||||
|
||||
QPlatformFontDatabase::registerFontFamily(familyName);
|
||||
|
@ -130,7 +130,7 @@ QByteArray QGenericUnixServices::desktopEnvironment() const
|
||||
|
||||
bool QGenericUnixServices::openUrl(const QUrl &url)
|
||||
{
|
||||
if (url.scheme() == QStringLiteral("mailto"))
|
||||
if (url.scheme() == QLatin1String("mailto"))
|
||||
return openDocument(url);
|
||||
|
||||
if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) {
|
||||
|
@ -234,11 +234,11 @@ void QKdeThemePrivate::refresh()
|
||||
const QVariant toolbarStyleValue = readKdeSetting(QStringLiteral("Toolbar style/ToolButtonStyle"), kdeDirs, kdeSettings);
|
||||
if (toolbarStyleValue.isValid()) {
|
||||
const QString toolBarStyle = toolbarStyleValue.toString();
|
||||
if (toolBarStyle == QStringLiteral("TextBesideIcon"))
|
||||
if (toolBarStyle == QLatin1String("TextBesideIcon"))
|
||||
toolButtonStyle = Qt::ToolButtonTextBesideIcon;
|
||||
else if (toolBarStyle == QStringLiteral("TextOnly"))
|
||||
else if (toolBarStyle == QLatin1String("TextOnly"))
|
||||
toolButtonStyle = Qt::ToolButtonTextOnly;
|
||||
else if (toolBarStyle == QStringLiteral("TextUnderIcon"))
|
||||
else if (toolBarStyle == QLatin1String("TextUnderIcon"))
|
||||
toolButtonStyle = Qt::ToolButtonTextUnderIcon;
|
||||
}
|
||||
|
||||
@ -640,7 +640,7 @@ QStringList QGenericUnixTheme::themeNames()
|
||||
result.push_back(QLatin1String(QGnomeTheme::name));
|
||||
}
|
||||
const QString session = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));
|
||||
if (!session.isEmpty() && session != QStringLiteral("default") && !result.contains(session))
|
||||
if (!session.isEmpty() && session != QLatin1String("default") && !result.contains(session))
|
||||
result.push_back(session);
|
||||
} // desktopSettingsAware
|
||||
if (result.isEmpty())
|
||||
|
@ -46,7 +46,7 @@ class QAndroidBearerEnginePlugin : public QBearerEnginePlugin
|
||||
public:
|
||||
QBearerEngine *create(const QString &key) const Q_DECL_OVERRIDE
|
||||
{
|
||||
return (key == QStringLiteral("android")) ? new QAndroidBearerEngine() : 0;
|
||||
return (key == QLatin1String("android")) ? new QAndroidBearerEngine() : 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
|
||||
QBearerEngine *QBBEnginePlugin::create(const QString &key) const
|
||||
{
|
||||
if (key == QStringLiteral("blackberry"))
|
||||
if (key == QLatin1String("blackberry"))
|
||||
return new QBBEngine;
|
||||
|
||||
return 0;
|
||||
|
@ -332,7 +332,7 @@ void QConnmanEngine::serviceStateChanged(const QString &state)
|
||||
QConnmanServiceInterface *service = qobject_cast<QConnmanServiceInterface *>(sender());
|
||||
configurationChange(service);
|
||||
|
||||
if (state == QStringLiteral("failure")) {
|
||||
if (state == QLatin1String("failure")) {
|
||||
emit connectionError(service->path(), ConnectError);
|
||||
}
|
||||
}
|
||||
@ -516,7 +516,7 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
|
||||
cpPriv->id = servicePath;
|
||||
cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
|
||||
|
||||
if (service->security() == QStringLiteral("none")) {
|
||||
if (service->security() == QLatin1String("none")) {
|
||||
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
|
||||
} else {
|
||||
cpPriv->purpose = QNetworkConfiguration::PrivatePurpose;
|
||||
|
@ -338,7 +338,7 @@ void QConnmanServiceInterface::connectNotify(const QMetaMethod &signal)
|
||||
void QConnmanServiceInterface::changedProperty(const QString &name, const QDBusVariant &value)
|
||||
{
|
||||
propertiesCacheMap[name] = value.variant();
|
||||
if (name == QStringLiteral("State"))
|
||||
if (name == QLatin1String("State"))
|
||||
Q_EMIT stateChanged(value.variant().toString());
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ QVariantMap QOfonoDataConnectionManagerInterface::getProperties()
|
||||
void QOfonoDataConnectionManagerInterface::propertyChanged(const QString &name, const QDBusVariant &value)
|
||||
{
|
||||
propertiesMap[name] = value.variant();
|
||||
if (name == QStringLiteral("RoamingAllowed"))
|
||||
if (name == QLatin1String("RoamingAllowed"))
|
||||
Q_EMIT roamingAllowedChanged(value.variant().toBool());
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ QComposeInputContext *QComposePlatformInputContextPlugin::create(const QString &
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
||||
if (system.compare(system, QStringLiteral("compose"), Qt::CaseInsensitive) == 0)
|
||||
if (system.compare(system, QLatin1String("compose"), Qt::CaseInsensitive) == 0)
|
||||
return new QComposeInputContext;
|
||||
return 0;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ QIBusPlatformInputContext *QIbusPlatformInputContextPlugin::create(const QString
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
||||
if (system.compare(system, QStringLiteral("ibus"), Qt::CaseInsensitive) == 0) {
|
||||
if (system.compare(system, QLatin1String("ibus"), Qt::CaseInsensitive) == 0) {
|
||||
qDBusRegisterMetaType<QIBusSerializable>();
|
||||
qDBusRegisterMetaType<QIBusAttribute>();
|
||||
qDBusRegisterMetaType<QIBusAttributeList>();
|
||||
|
@ -164,9 +164,9 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶
|
||||
bool QAndroidPlatformIntegration::needsBasicRenderloopWorkaround()
|
||||
{
|
||||
static bool needsWorkaround =
|
||||
QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0
|
||||
|| QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0
|
||||
|| QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0;
|
||||
QtAndroid::deviceName().compare(QLatin1String("samsung SM-T211"), Qt::CaseInsensitive) == 0
|
||||
|| QtAndroid::deviceName().compare(QLatin1String("samsung SM-T210"), Qt::CaseInsensitive) == 0
|
||||
|| QtAndroid::deviceName().compare(QLatin1String("samsung SM-T215"), Qt::CaseInsensitive) == 0;
|
||||
return needsWorkaround;
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ QMacPasteboard::setMimeData(QMimeData *mime_src)
|
||||
// Hack: The Rtf handler converts incoming Rtf to Html. We do
|
||||
// not want to convert outgoing Html to Rtf but instead keep
|
||||
// posting it as Html. Skip the Rtf handler here.
|
||||
if (c->convertorName() == QStringLiteral("Rtf"))
|
||||
if (c->convertorName() == QLatin1String("Rtf"))
|
||||
continue;
|
||||
QString flavor(c->flavorFor(mimeType));
|
||||
if (!flavor.isEmpty()) {
|
||||
|
@ -301,7 +301,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
||||
|
||||
// For widgets we need to do a bit of trickery as the window
|
||||
// to activate is the window of the top-level widget.
|
||||
if (m_window->metaObject()->className() == QStringLiteral("QWidgetWindow")) {
|
||||
if (qstrcmp(m_window->metaObject()->className(), "QWidgetWindow") == 0) {
|
||||
while (focusWindow->parent()) {
|
||||
focusWindow = focusWindow->parent();
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
|
||||
QPlatformIntegration *QWindowsDirect2DIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
if (system.compare(system, QStringLiteral("direct2d"), Qt::CaseInsensitive) == 0)
|
||||
if (system.compare(system, QLatin1String("direct2d"), Qt::CaseInsensitive) == 0)
|
||||
return QWindowsDirect2DIntegration::create(paramList);
|
||||
return 0;
|
||||
}
|
||||
|
@ -187,8 +187,8 @@ QIOSScreen::QIOSScreen(UIScreen *screen)
|
||||
if (screen == [UIScreen mainScreen]) {
|
||||
QString deviceIdentifier = deviceModelIdentifier();
|
||||
|
||||
if (deviceIdentifier == QStringLiteral("iPhone2,1") /* iPhone 3GS */
|
||||
|| deviceIdentifier == QStringLiteral("iPod3,1") /* iPod touch 3G */) {
|
||||
if (deviceIdentifier == QLatin1String("iPhone2,1") /* iPhone 3GS */
|
||||
|| deviceIdentifier == QLatin1String("iPod3,1") /* iPod touch 3G */) {
|
||||
m_depth = 18;
|
||||
} else {
|
||||
m_depth = 24;
|
||||
|
@ -107,9 +107,9 @@ void QQnxNativeInterface::setWindowProperty(QPlatformWindow *window, const QStri
|
||||
{
|
||||
QQnxWindow *qnxWindow = static_cast<QQnxWindow*>(window);
|
||||
|
||||
if (name == QStringLiteral("mmRendererWindowName")) {
|
||||
if (name == QLatin1String("mmRendererWindowName")) {
|
||||
qnxWindow->setMMRendererWindowName(value.toString());
|
||||
} else if (name == QStringLiteral("qnxWindowGroup")) {
|
||||
} else if (name == QLatin1String("qnxWindowGroup")) {
|
||||
if (value.isNull())
|
||||
qnxWindow->joinWindowGroup(QByteArray());
|
||||
else if (value.canConvert<QByteArray>())
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
|
||||
QPlatformIntegration *QWindowsIntegrationPlugin::create(const QString& system, const QStringList& paramList, int &, char **)
|
||||
{
|
||||
if (system.compare(system, QStringLiteral("windows"), Qt::CaseInsensitive) == 0)
|
||||
if (system.compare(system, QLatin1String("windows"), Qt::CaseInsensitive) == 0)
|
||||
return new QWindowsGdiIntegration(paramList);
|
||||
return 0;
|
||||
}
|
||||
|
@ -853,7 +853,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
int type)
|
||||
{
|
||||
// the "@family" fonts are just the same as "family". Ignore them.
|
||||
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
|
||||
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QLatin1String("WST_")))
|
||||
return false;
|
||||
|
||||
static const int SMOOTH_SCALABLE = 0xffff;
|
||||
@ -918,7 +918,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
// display Thai text by default. As a temporary work around, we special case Segoe UI
|
||||
// and remove the Thai script from its list of supported writing systems.
|
||||
if (writingSystems.supported(QFontDatabase::Thai) &&
|
||||
familyName == QStringLiteral("Segoe UI"))
|
||||
familyName == QLatin1String("Segoe UI"))
|
||||
writingSystems.setSupported(QFontDatabase::Thai, false);
|
||||
} else {
|
||||
const QFontDatabase::WritingSystem ws = writingSystemFromCharSet(charSet);
|
||||
@ -1591,7 +1591,7 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request)
|
||||
&& (request.style == QFont::StyleItalic || (-lf.lfHeight > 18 && -lf.lfHeight != 24))) {
|
||||
fam = QStringLiteral("Arial"); // MS Sans Serif has bearing problems in italic, and does not scale
|
||||
}
|
||||
if (fam == QStringLiteral("Courier") && !(request.styleStrategy & QFont::PreferBitmap))
|
||||
if (fam == QLatin1String("Courier") && !(request.styleStrategy & QFont::PreferBitmap))
|
||||
fam = QStringLiteral("Courier New");
|
||||
|
||||
memcpy(lf.lfFaceName, fam.utf16(), sizeof(wchar_t) * qMin(fam.length() + 1, 32)); // 32 = Windows hard-coded
|
||||
@ -1703,18 +1703,18 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
|
||||
if (rawMode) { // will choose a stock font
|
||||
int f = SYSTEM_FONT;
|
||||
const QString fam = request.family.toLower();
|
||||
if (fam == QStringLiteral("default") || fam == QStringLiteral("system"))
|
||||
if (fam == QLatin1String("default") || fam == QLatin1String("system"))
|
||||
f = SYSTEM_FONT;
|
||||
#ifndef Q_OS_WINCE
|
||||
else if (fam == QStringLiteral("system_fixed"))
|
||||
else if (fam == QLatin1String("system_fixed"))
|
||||
f = SYSTEM_FIXED_FONT;
|
||||
else if (fam == QStringLiteral("ansi_fixed"))
|
||||
else if (fam == QLatin1String("ansi_fixed"))
|
||||
f = ANSI_FIXED_FONT;
|
||||
else if (fam == QStringLiteral("ansi_var"))
|
||||
else if (fam == QLatin1String("ansi_var"))
|
||||
f = ANSI_VAR_FONT;
|
||||
else if (fam == QStringLiteral("device_default"))
|
||||
else if (fam == QLatin1String("device_default"))
|
||||
f = DEVICE_DEFAULT_FONT;
|
||||
else if (fam == QStringLiteral("oem_fixed"))
|
||||
else if (fam == QLatin1String("oem_fixed"))
|
||||
f = OEM_FIXED_FONT;
|
||||
#endif
|
||||
else if (fam.at(0) == QLatin1Char('#'))
|
||||
@ -1835,7 +1835,7 @@ QFont QWindowsFontDatabase::systemDefaultFont()
|
||||
GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(lf), &lf);
|
||||
QFont systemFont = QWindowsFontDatabase::LOGFONT_to_QFont(lf);
|
||||
// "MS Shell Dlg 2" is the correct system font >= Win2k
|
||||
if (systemFont.family() == QStringLiteral("MS Shell Dlg"))
|
||||
if (systemFont.family() == QLatin1String("MS Shell Dlg"))
|
||||
systemFont.setFamily(QStringLiteral("MS Shell Dlg 2"));
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__ << systemFont;
|
||||
return systemFont;
|
||||
|
@ -122,7 +122,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
typedef QPair<QString, QStringList> FontKey;
|
||||
|
||||
// the "@family" fonts are just the same as "family". Ignore them.
|
||||
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
|
||||
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QLatin1String("WST_")))
|
||||
return false;
|
||||
|
||||
const int separatorPos = familyName.indexOf(QStringLiteral("::"));
|
||||
@ -181,7 +181,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
// display Thai text by default. As a temporary work around, we special case Segoe UI
|
||||
// and remove the Thai script from its list of supported writing systems.
|
||||
if (writingSystems.supported(QFontDatabase::Thai) &&
|
||||
faceName == QStringLiteral("Segoe UI"))
|
||||
faceName == QLatin1String("Segoe UI"))
|
||||
writingSystems.setSupported(QFontDatabase::Thai, false);
|
||||
} else {
|
||||
const QFontDatabase::WritingSystem ws = writingSystemFromCharSet(charSet);
|
||||
|
@ -761,7 +761,7 @@ bool QWindowsMimeURI::convertFromMime(const FORMATETC &formatetc, const QMimeDat
|
||||
|
||||
bool QWindowsMimeURI::canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const
|
||||
{
|
||||
return mimeType == QStringLiteral("text/uri-list")
|
||||
return mimeType == QLatin1String("text/uri-list")
|
||||
&& (canGetData(CF_HDROP, pDataObj) || canGetData(CF_INETURL_W, pDataObj) || canGetData(CF_INETURL, pDataObj));
|
||||
}
|
||||
|
||||
@ -776,7 +776,7 @@ QString QWindowsMimeURI::mimeForFormat(const FORMATETC &formatetc) const
|
||||
QVector<FORMATETC> QWindowsMimeURI::formatsForMime(const QString &mimeType, const QMimeData *mimeData) const
|
||||
{
|
||||
QVector<FORMATETC> formatics;
|
||||
if (mimeType == QStringLiteral("text/uri-list")) {
|
||||
if (mimeType == QLatin1String("text/uri-list")) {
|
||||
if (canConvertFromMime(setCf(CF_HDROP), mimeData))
|
||||
formatics += setCf(CF_HDROP);
|
||||
if (canConvertFromMime(setCf(CF_INETURL_W), mimeData))
|
||||
@ -789,7 +789,7 @@ QVector<FORMATETC> QWindowsMimeURI::formatsForMime(const QString &mimeType, cons
|
||||
|
||||
QVariant QWindowsMimeURI::convertToMime(const QString &mimeType, LPDATAOBJECT pDataObj, QVariant::Type preferredType) const
|
||||
{
|
||||
if (mimeType == QStringLiteral("text/uri-list")) {
|
||||
if (mimeType == QLatin1String("text/uri-list")) {
|
||||
if (canGetData(CF_HDROP, pDataObj)) {
|
||||
QByteArray texturi;
|
||||
QList<QVariant> urls;
|
||||
@ -862,7 +862,7 @@ QWindowsMimeHtml::QWindowsMimeHtml()
|
||||
QVector<FORMATETC> QWindowsMimeHtml::formatsForMime(const QString &mimeType, const QMimeData *mimeData) const
|
||||
{
|
||||
QVector<FORMATETC> formatetcs;
|
||||
if (mimeType == QStringLiteral("text/html") && (!mimeData->html().isEmpty()))
|
||||
if (mimeType == QLatin1String("text/html") && (!mimeData->html().isEmpty()))
|
||||
formatetcs += setCf(CF_HTML);
|
||||
return formatetcs;
|
||||
}
|
||||
@ -876,7 +876,7 @@ QString QWindowsMimeHtml::mimeForFormat(const FORMATETC &formatetc) const
|
||||
|
||||
bool QWindowsMimeHtml::canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const
|
||||
{
|
||||
return mimeType == QStringLiteral("text/html") && canGetData(CF_HTML, pDataObj);
|
||||
return mimeType == QLatin1String("text/html") && canGetData(CF_HTML, pDataObj);
|
||||
}
|
||||
|
||||
|
||||
@ -998,7 +998,7 @@ QWindowsMimeImage::QWindowsMimeImage()
|
||||
QVector<FORMATETC> QWindowsMimeImage::formatsForMime(const QString &mimeType, const QMimeData *mimeData) const
|
||||
{
|
||||
QVector<FORMATETC> formatetcs;
|
||||
if (mimeData->hasImage() && mimeType == QStringLiteral("application/x-qt-image")) {
|
||||
if (mimeData->hasImage() && mimeType == QLatin1String("application/x-qt-image")) {
|
||||
//add DIBV5 if image has alpha channel
|
||||
QImage image = qvariant_cast<QImage>(mimeData->imageData());
|
||||
if (!image.isNull() && image.hasAlphaChannel())
|
||||
@ -1018,7 +1018,7 @@ QString QWindowsMimeImage::mimeForFormat(const FORMATETC &formatetc) const
|
||||
|
||||
bool QWindowsMimeImage::canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const
|
||||
{
|
||||
if ((mimeType == QStringLiteral("application/x-qt-image")) &&
|
||||
if (mimeType == QLatin1String("application/x-qt-image") &&
|
||||
(canGetData(CF_DIB, pDataObj) || canGetData(CF_PNG, pDataObj)))
|
||||
return true;
|
||||
return false;
|
||||
@ -1158,7 +1158,7 @@ bool QBuiltInMimes::convertFromMime(const FORMATETC &formatetc, const QMimeData
|
||||
{
|
||||
if (canConvertFromMime(formatetc, mimeData)) {
|
||||
QByteArray data;
|
||||
if (outFormats.value(getCf(formatetc)) == QStringLiteral("text/html")) {
|
||||
if (outFormats.value(getCf(formatetc)) == QLatin1String("text/html")) {
|
||||
// text/html is in wide chars on windows (compatible with mozillia)
|
||||
QString html = mimeData->html();
|
||||
// same code as in the text converter up above
|
||||
@ -1224,7 +1224,7 @@ QVariant QBuiltInMimes::convertToMime(const QString &mimeType, IDataObject *pDat
|
||||
#ifdef QMIME_DEBUG
|
||||
qDebug("QBuiltInMimes::convertToMime()");
|
||||
#endif
|
||||
if (mimeType == QStringLiteral("text/html") && preferredType == QVariant::String) {
|
||||
if (mimeType == QLatin1String("text/html") && preferredType == QVariant::String) {
|
||||
// text/html is in wide chars on windows (compatible with Mozilla)
|
||||
val = QString::fromWCharArray((const wchar_t *)data.data());
|
||||
} else {
|
||||
|
@ -146,7 +146,7 @@ static inline bool launchMail(const QUrl &url)
|
||||
bool QWindowsServices::openUrl(const QUrl &url)
|
||||
{
|
||||
const QString scheme = url.scheme();
|
||||
if (scheme == QStringLiteral("mailto") && launchMail(url))
|
||||
if (scheme == QLatin1String("mailto") && launchMail(url))
|
||||
return true;
|
||||
return shellExecute(url);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ QStringList QCupsPrinterSupportPlugin::keys() const
|
||||
|
||||
QPlatformPrinterSupport *QCupsPrinterSupportPlugin::create(const QString &key)
|
||||
{
|
||||
if (key.compare(key, QStringLiteral("cupsprintersupport"), Qt::CaseInsensitive) == 0)
|
||||
if (key.compare(key, QLatin1String("cupsprintersupport"), Qt::CaseInsensitive) == 0)
|
||||
return new QCupsPrinterSupport;
|
||||
return 0;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
|
||||
QPlatformPrinterSupport *QWindowsPrinterSupportPlugin::create(const QString &key)
|
||||
{
|
||||
if (key.compare(key, QStringLiteral("windowsprintsupport"), Qt::CaseInsensitive) == 0)
|
||||
if (key.compare(key, QLatin1String("windowsprintsupport"), Qt::CaseInsensitive) == 0)
|
||||
return new QWindowsPrinterSupport;
|
||||
return 0;
|
||||
}
|
||||
|
@ -2640,8 +2640,8 @@ void QTest::ignoreMessage(QtMsgType type, const QRegularExpression &messagePatte
|
||||
#ifdef Q_OS_WIN
|
||||
static inline bool isWindowsBuildDirectory(const QString &dirName)
|
||||
{
|
||||
return dirName.compare(QStringLiteral("Debug"), Qt::CaseInsensitive) == 0
|
||||
|| dirName.compare(QStringLiteral("Release"), Qt::CaseInsensitive) == 0;
|
||||
return dirName.compare(QLatin1String("Debug"), Qt::CaseInsensitive) == 0
|
||||
|| dirName.compare(QLatin1String("Release"), Qt::CaseInsensitive) == 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -4439,7 +4439,7 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
|
||||
continue;
|
||||
if (tag.at(0) == '-')
|
||||
continue;
|
||||
if (tag == QStringLiteral("qt"))
|
||||
if (tag == QLatin1String("qt"))
|
||||
continue;
|
||||
if (tag.startsWith("example"))
|
||||
continue;
|
||||
|
@ -182,9 +182,9 @@ int runRcc(int argc, char *argv[])
|
||||
if (parser.isSet(binaryOption))
|
||||
library.setFormat(RCCResourceLibrary::Binary);
|
||||
if (parser.isSet(passOption)) {
|
||||
if (parser.value(passOption) == QStringLiteral("1"))
|
||||
if (parser.value(passOption) == QLatin1String("1"))
|
||||
library.setFormat(RCCResourceLibrary::Pass1);
|
||||
else if (parser.value(passOption) == QStringLiteral("2"))
|
||||
else if (parser.value(passOption) == QLatin1String("2"))
|
||||
library.setFormat(RCCResourceLibrary::Pass2);
|
||||
else
|
||||
errorMsg = QLatin1String("Pass number must be 1 or 2");
|
||||
|
@ -326,7 +326,7 @@ bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
|
||||
|
||||
// no QPlatformSystemTrayIcon so fall back to default xcb platform behavior
|
||||
const QString platform = QGuiApplication::platformName();
|
||||
if (platform.compare(QStringLiteral("xcb"), Qt::CaseInsensitive) == 0)
|
||||
if (platform.compare(QLatin1String("xcb"), Qt::CaseInsensitive) == 0)
|
||||
return locateSystemTray();
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user