diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qglobal_p.h | 32 | ||||
-rw-r--r-- | src/corelib/io/qloggingregistry.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qsettings_mac.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qurl.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_foundation.mm | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qdeadlinetimer.cpp | 32 | ||||
-rw-r--r-- | src/corelib/kernel/qdeadlinetimer.h | 32 | ||||
-rw-r--r-- | src/corelib/mimetypes/qmimeglobpattern_p.h | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/qfinalstate_p.h | 34 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 6 | ||||
-rw-r--r-- | src/corelib/tools/qlocale_win.cpp | 13 | ||||
-rw-r--r-- | src/corelib/tools/qregularexpression.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstringbuilder.h | 22 | ||||
-rw-r--r-- | src/corelib/tools/qtimezoneprivate_icu.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qtimezoneprivate_win.cpp | 2 |
15 files changed, 104 insertions, 98 deletions
diff --git a/src/corelib/global/qglobal_p.h b/src/corelib/global/qglobal_p.h index b8f9e5fbf7..b1d2836783 100644 --- a/src/corelib/global/qglobal_p.h +++ b/src/corelib/global/qglobal_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2015 Intel Corporation. -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index 4f7bc95330..ff865dc9a1 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -215,7 +215,7 @@ void QLoggingSettingsParser::setContent(QTextStream &stream) continue; } - if (_section.toLower() == QLatin1String("rules")) { + if (_section.compare(QLatin1String("rules"), Qt::CaseInsensitive) == 0) { int equalPos = line.indexOf(QLatin1Char('=')); if (equalPos != -1) { if (line.lastIndexOf(QLatin1Char('=')) == equalPos) { diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp index e4631bad12..2a08ee2e64 100644 --- a/src/corelib/io/qsettings_mac.cpp +++ b/src/corelib/io/qsettings_mac.cpp @@ -211,7 +211,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value) default: QString string = QSettingsPrivate::variantToString(value); if (string.contains(QChar::Null)) - result = string.toUtf8().toCFData(); + result = std::move(string).toUtf8().toCFData(); else result = string.toCFString(); } @@ -419,14 +419,13 @@ QMacSettingsPrivate::QMacSettingsPrivate(QSettings::Scope scope, const QString & curPos = nextDot + 1; } javaPackageName.prepend(domainName.midRef(curPos)); - javaPackageName = javaPackageName.toLower(); + javaPackageName = std::move(javaPackageName).toLower(); if (curPos == 0) javaPackageName.prepend(QLatin1String("com.")); suiteId = javaPackageName; if (!application.isEmpty()) { - javaPackageName += QLatin1Char('.'); - javaPackageName += application; + javaPackageName += QLatin1Char('.') + application; applicationId = javaPackageName; } diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index b5772b5ce2..9663235a67 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3418,8 +3418,7 @@ QUrl QUrl::adjusted(QUrl::FormattingOptions options) const QByteArray QUrl::toEncoded(FormattingOptions options) const { options &= ~(FullyDecoded | FullyEncoded); - QString stringForm = toString(options | FullyEncoded); - return stringForm.toLatin1(); + return toString(options | FullyEncoded).toLatin1(); } /*! @@ -3536,8 +3535,7 @@ QString QUrl::fromAce(const QByteArray &domain) */ QByteArray QUrl::toAce(const QString &domain) { - QString result = qt_ACE_do(domain, ToAceOnly, ForbidLeadingDot /*FIXME: make configurable*/); - return result.toLatin1(); + return qt_ACE_do(domain, ToAceOnly, ForbidLeadingDot /*FIXME: make configurable*/).toLatin1(); } /*! diff --git a/src/corelib/kernel/qcore_foundation.mm b/src/corelib/kernel/qcore_foundation.mm index 0e69f69a85..56eabc4b8c 100644 --- a/src/corelib/kernel/qcore_foundation.mm +++ b/src/corelib/kernel/qcore_foundation.mm @@ -328,6 +328,8 @@ NSUUID *QUuid::toNSUUID() const */ QUrl QUrl::fromCFURL(CFURLRef url) { + if (!url) + return QUrl(); return QUrl(QString::fromCFString(CFURLGetString(url))); } @@ -355,6 +357,8 @@ CFURLRef QUrl::toCFURL() const */ QUrl QUrl::fromNSURL(const NSURL *url) { + if (!url) + return QUrl(); return QUrl(QString::fromNSString([url absoluteString])); } diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp index ad549dcd7b..a2ec813f11 100644 --- a/src/corelib/kernel/qdeadlinetimer.cpp +++ b/src/corelib/kernel/qdeadlinetimer.cpp @@ -1,31 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2016 Intel Corporation. -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h index aa0f735fcc..ddab0191ad 100644 --- a/src/corelib/kernel/qdeadlinetimer.h +++ b/src/corelib/kernel/qdeadlinetimer.h @@ -1,31 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2016 Intel Corporation. -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h index c8b70464fd..21332e71bc 100644 --- a/src/corelib/mimetypes/qmimeglobpattern_p.h +++ b/src/corelib/mimetypes/qmimeglobpattern_p.h @@ -83,11 +83,9 @@ public: static const unsigned MinWeight = 1; explicit QMimeGlobPattern(const QString &thePattern, const QString &theMimeType, unsigned theWeight = DefaultWeight, Qt::CaseSensitivity s = Qt::CaseInsensitive) : - m_pattern(thePattern), m_mimeType(theMimeType), m_weight(theWeight), m_caseSensitivity(s) + m_pattern(s == Qt::CaseInsensitive ? thePattern.toLower() : thePattern), + m_mimeType(theMimeType), m_weight(theWeight), m_caseSensitivity(s) { - if (s == Qt::CaseInsensitive) { - m_pattern = m_pattern.toLower(); - } } void swap(QMimeGlobPattern &other) Q_DECL_NOTHROW diff --git a/src/corelib/statemachine/qfinalstate_p.h b/src/corelib/statemachine/qfinalstate_p.h index 57de703fe9..65598f6c19 100644 --- a/src/corelib/statemachine/qfinalstate_p.h +++ b/src/corelib/statemachine/qfinalstate_p.h @@ -1,31 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 0448a78160..9be20e6676 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -3052,7 +3052,7 @@ QString QLocaleData::doubleToString(const QChar _zero, const QChar plus, const Q num_str.prepend(QLatin1Char(' ')); if (flags & QLocaleData::CapitalEorX) - num_str = num_str.toUpper(); + num_str = std::move(num_str).toUpper(); return num_str; } @@ -3134,7 +3134,7 @@ QString QLocaleData::longLongToString(const QChar zero, const QChar group, } if (flags & CapitalEorX) - num_str = num_str.toUpper(); + num_str = std::move(num_str).toUpper(); if (base == 16 && (flags & ShowBase)) num_str.prepend(QLatin1String(flags & UppercaseBase ? "0X" : "0x")); @@ -3213,7 +3213,7 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group, } if (flags & CapitalEorX) - num_str = num_str.toUpper(); + num_str = std::move(num_str).toUpper(); if (base == 16 && flags & ShowBase) num_str.prepend(QLatin1String(flags & UppercaseBase ? "0X" : "0x")); diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index d1abb8b565..2475859abd 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -1037,7 +1037,7 @@ static QString winIso639LangName(LPWSTR id) if (!lang_code.isEmpty()) { const char *endptr; bool ok; - QByteArray latin1_lang_code = lang_code.toLatin1(); + QByteArray latin1_lang_code = std::move(lang_code).toLatin1(); int i = qstrtoull(latin1_lang_code, &endptr, 16, &ok); if (ok && *endptr == '\0') { switch (i) { @@ -1120,15 +1120,12 @@ static QByteArray getWinLocaleName(LPWSTR id) id = lcName; } #endif // Q_OS_WINRT - QString resultuage = winIso639LangName(id); + QString resultusage = winIso639LangName(id); QString country = winIso3116CtryName(id); - result = resultuage.toLatin1(); - if (!country.isEmpty()) { - result += '_'; - result += country.toLatin1(); - } + if (!country.isEmpty()) + resultusage += QLatin1Char('_') + country; - return result; + return std::move(resultusage).toLatin1(); } Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id) diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 8366e01ee8..f1fac093b0 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -1674,7 +1674,7 @@ QString QRegularExpression::errorString() const } while (errorStringLength < 0); errorString.resize(errorStringLength); - return QCoreApplication::translate("QRegularExpression", errorString.toLatin1().constData()); + return QCoreApplication::translate("QRegularExpression", std::move(errorString).toLatin1().constData()); } return QCoreApplication::translate("QRegularExpression", "no error"); } diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index b2832b5fbe..9a40abcfed 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -277,9 +277,9 @@ template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable } }; -template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable +template <int N> struct QConcatenable<const char[N]> : private QAbstractConcatenable { - typedef char type[N]; + typedef const char type[N]; typedef QByteArray ConvertTo; enum { ExactSize = false }; static int size(const char[N]) { return N - 1; } @@ -296,23 +296,9 @@ template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable } }; -template <int N> struct QConcatenable<const char[N]> : private QAbstractConcatenable +template <int N> struct QConcatenable<char[N]> : QConcatenable<const char[N]> { - typedef const char type[N]; - typedef QByteArray ConvertTo; - enum { ExactSize = false }; - static int size(const char[N]) { return N - 1; } -#ifndef QT_NO_CAST_FROM_ASCII - static inline void QT_ASCII_CAST_WARN appendTo(const char a[N], QChar *&out) - { - QAbstractConcatenable::convertFromAscii(a, N - 1, out); - } -#endif - static inline void appendTo(const char a[N], char *&out) - { - while (*a) - *out++ = *a++; - } + typedef char type[N]; }; template <> struct QConcatenable<const char *> : private QAbstractConcatenable diff --git a/src/corelib/tools/qtimezoneprivate_icu.cpp b/src/corelib/tools/qtimezoneprivate_icu.cpp index a07b2593b9..5570ce7571 100644 --- a/src/corelib/tools/qtimezoneprivate_icu.cpp +++ b/src/corelib/tools/qtimezoneprivate_icu.cpp @@ -98,7 +98,7 @@ static QByteArray ucalDefaultTimeZoneId() // If successful on first or second go, resize and return if (U_SUCCESS(status)) { result.resize(size); - return result.toUtf8(); + return std::move(result).toUtf8(); } return QByteArray(); diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp index c6d59be3d8..a50227d3cc 100644 --- a/src/corelib/tools/qtimezoneprivate_win.cpp +++ b/src/corelib/tools/qtimezoneprivate_win.cpp @@ -299,7 +299,7 @@ static QByteArray windowsSystemZoneId() id = readRegistryString(key, L"TimeZoneKeyName"); RegCloseKey(key); if (!id.isEmpty()) - return id.toUtf8(); + return std::move(id).toUtf8(); } // On XP we have to iterate over the zones until we find a match on |