aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/qbs-setup-qt
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2019-02-26 14:38:54 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2019-02-26 15:52:26 +0000
commit4fd17d627106fde01284075038e15cc0680611bc (patch)
tree25c5b7e8ec774d362ad97e86d0ecd1d8527fbac5 /src/app/qbs-setup-qt
parent0b8f0b771080e51a59664782ced6b3a1cc5111ca (diff)
Return initializer list where it is possible
This fixes this clang-tidy warning: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Change-Id: I421e1e47462fe0e97788672684d47943af7df850 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/app/qbs-setup-qt')
-rw-r--r--src/app/qbs-setup-qt/setupqt.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/app/qbs-setup-qt/setupqt.cpp b/src/app/qbs-setup-qt/setupqt.cpp
index 498b73d99..7905d0823 100644
--- a/src/app/qbs-setup-qt/setupqt.cpp
+++ b/src/app/qbs-setup-qt/setupqt.cpp
@@ -122,14 +122,14 @@ std::vector<QtEnvironment> SetupQt::fetchEnvironments()
static QStringList qbsToolchainFromDirName(const QString &dir)
{
if (dir.startsWith(QLatin1String("msvc")))
- return QStringList(QStringLiteral("msvc"));
+ return {QStringLiteral("msvc")};
if (dir.startsWith(QLatin1String("mingw")))
- return QStringList{QStringLiteral("mingw"), QStringLiteral("gcc")};
+ return {QStringLiteral("mingw"), QStringLiteral("gcc")};
if (dir.startsWith(QLatin1String("clang")))
- return QStringList{QStringLiteral("clang"), QStringLiteral("llvm"), QStringLiteral("gcc")};
+ return {QStringLiteral("clang"), QStringLiteral("llvm"), QStringLiteral("gcc")};
if (dir.startsWith(QLatin1String("gcc")))
- return QStringList(QStringLiteral("gcc"));
- return QStringList();
+ return {QStringLiteral("gcc")};
+ return {};
}
static Version msvcVersionFromDirName(const QString &dir)
@@ -138,7 +138,7 @@ static Version msvcVersionFromDirName(const QString &dir)
std::smatch match;
const std::string dirString = dir.toStdString();
if (!std::regex_match(dirString, match, regexp))
- return Version();
+ return Version{};
QMap<std::string, std::string> mapping{
std::make_pair("2005", "14"), std::make_pair("2008", "15"), std::make_pair("2010", "16"),
std::make_pair("2012", "17"), std::make_pair("2013", "18"), std::make_pair("2015", "19"),
@@ -153,7 +153,7 @@ static QString archFromDirName(const QString &dir)
std::smatch match;
const std::string dirString = dir.toStdString();
if (!std::regex_match(dirString, match, regexp))
- return QString();
+ return {};
const QString arch = QString::fromStdString(match[1]);
if (arch == QLatin1String("32"))
return QStringLiteral("x86");