diff options
author | Liang Qi <liang.qi@qt.io> | 2017-03-27 12:11:15 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-03-27 12:11:15 +0200 |
commit | ef4e761c7519449ff9bb0d0b14bd50c03228a39e (patch) | |
tree | 38a7bd19b15517030412f436a9e596be86b7a0b7 | |
parent | 3947d229cb8ed8dde5ab72708a4a149ac6d83cae (diff) | |
parent | ae4823946c7ab4037d4bde8d4d0e43c046fea4cf (diff) | |
download | qttools-ef4e761c7519449ff9bb0d0b14bd50c03228a39e.tar.gz |
Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: I73fad6fed560b8df8382cb9c17fe295a74ef3553
-rw-r--r-- | src/androiddeployqt/main.cpp | 17 | ||||
-rw-r--r-- | src/designer/src/lib/shared/layout.cpp | 4 | ||||
-rw-r--r-- | src/linguist/lupdate/cpp.cpp | 8 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 8 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result | 6 |
5 files changed, 23 insertions, 20 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp index 26e9adb7b..3eaaa399f 100644 --- a/src/androiddeployqt/main.cpp +++ b/src/androiddeployqt/main.cpp @@ -945,7 +945,7 @@ bool copyAndroidTemplate(const Options &options, const QString &androidTemplate, bool copyGradleTemplate(const Options &options) { - QDir sourceDirectory(options.sdkPath + QLatin1String("/tools/templates/gradle/wrapper")); + QDir sourceDirectory(options.qtInstallDirectory + QLatin1String("/src/3rdparty/gradle")); if (!sourceDirectory.exists()) { fprintf(stderr, "Cannot find template directory %s\n", qPrintable(sourceDirectory.absolutePath())); return false; @@ -2363,18 +2363,6 @@ static bool mergeGradleProperties(const QString &path, GradleProperties properti return true; } -bool updateGradleDistributionUrl(const QString &path) { - // check if we are using gradle 2.x - GradleProperties gradleProperties = readGradleProperties(path); - QString distributionUrl = QString::fromLocal8Bit(gradleProperties["distributionUrl"]); - QRegExp re(QLatin1String(".*services.gradle.org/distributions/gradle-2..*.zip")); - if (!re.exactMatch(distributionUrl)) { - gradleProperties["distributionUrl"] = "https\\://services.gradle.org/distributions/gradle-2.2.1-all.zip"; - return mergeGradleProperties(path, gradleProperties); - } - return true; -} - bool buildGradleProject(const Options &options) { GradleProperties localProperties; @@ -2394,9 +2382,6 @@ bool buildGradleProject(const Options &options) if (!mergeGradleProperties(gradlePropertiesPath, gradleProperties)) return false; - if (!updateGradleDistributionUrl(options.outputDirectory + QLatin1String("gradle/wrapper/gradle-wrapper.properties"))) - return false; - #if defined(Q_OS_WIN32) QString gradlePath(options.outputDirectory + QLatin1String("gradlew.bat")); #else diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp index 9c1c4c357..cbff00e47 100644 --- a/src/designer/src/lib/shared/layout.cpp +++ b/src/designer/src/lib/shared/layout.cpp @@ -597,7 +597,7 @@ public: void setCells(const QRect &c, QWidget* w); - bool empty() const { return m_nrows * m_ncols; } + bool empty() const { return !m_nrows || !m_ncols; } int numRows() const { return m_nrows; } int numCols() const { return m_ncols; } @@ -1111,7 +1111,7 @@ void GridLayout<GridLikeLayout, LayoutType, GridMode>::doLayout() GridLikeLayout *layout = static_cast<GridLikeLayout *>(createLayout(LayoutType)); - if (m_grid.empty()) + if (!m_grid.empty()) sort(); QDesignerWidgetItemInstaller wii; // Make sure we use QDesignerWidgetItem. diff --git a/src/linguist/lupdate/cpp.cpp b/src/linguist/lupdate/cpp.cpp index 22189b037..71ac8cf16 100644 --- a/src/linguist/lupdate/cpp.cpp +++ b/src/linguist/lupdate/cpp.cpp @@ -1494,13 +1494,17 @@ QString CppParser::transcode(const QString &str) if (c == '\n') continue; - if (c == 'x') { + if (c == 'x' || c == 'u' || c == 'U') { + const bool unicode = (c != 'x'); QByteArray hex; while (i < in.length() && isxdigit((c = in[i]))) { hex += c; i++; } - out += hex.toUInt(0, 16); + if (unicode) + out += QString(QChar(hex.toUInt(nullptr, 16))).toUtf8(); + else + out += hex.toUInt(nullptr, 16); } else if (c >= '0' && c < '8') { QByteArray oct; int n = 0; diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp index 3f3a99c48..1bc1dc2a2 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -647,3 +647,11 @@ QObject::tr("message after system include without space"); #include"qobject.h" QObject::tr("message after local include without space"); + + + +// QTBUG-35164: handling of \uNNNN escapes +QString unicodeEscape() +{ + return QApplication::tr("Context", "soft\u00ADhyphen"); +} diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index 683c2aef3..c344667cf 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -295,6 +295,12 @@ backslashed \ stuff.</source> <comment>Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.</comment> <translation type="unfinished"></translation> </message> + <message> + <location filename="main.cpp" line="656"/> + <source>Context</source> + <comment>softhyphen</comment> + <translation type="unfinished"></translation> + </message> </context> <context> <name>QCoreApplication</name> |