diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-23 13:56:43 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-09-23 13:56:43 +0000 |
commit | 90ad487d31effc2845c74f92cf4b101462eaa00d (patch) | |
tree | f2456ec839c2f9101f4a986daa676c68f0cfbded | |
parent | 3ce07c3238b335a7019d8dfabde6bab3f16d342d (diff) | |
parent | 53bd8140bb5ee3ce1a9f138b1c862a67b6dd4eaa (diff) | |
download | qtbase-90ad487d31effc2845c74f92cf4b101462eaa00d.tar.gz |
Merge "Merge remote-tracking branch 'origin/5.6.2' into 5.6" into refs/staging/5.6
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 48 | ||||
-rw-r--r-- | src/gui/text/qrawfont.cpp | 16 |
2 files changed, 46 insertions, 18 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 5e37cd65d8..59e7991d4c 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -496,6 +496,32 @@ static QString xcodeFiletypeForFilename(const QString &filename) return QString(); } +static bool compareProvisioningTeams(const QVariantMap &a, const QVariantMap &b) +{ + int aFree = a.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0; + int bFree = b.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0; + return aFree < bFree; +} + +static QList<QVariantMap> provisioningTeams() +{ + const QSettings xcodeSettings( + QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"), + QSettings::NativeFormat); + const QVariantMap teamMap = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap(); + QList<QVariantMap> flatTeams; + for (QVariantMap::const_iterator it = teamMap.begin(), end = teamMap.end(); it != end; ++it) { + const QString emailAddress = it.key(); + QVariantMap team = it.value().toMap(); + team[QLatin1String("emailAddress")] = emailAddress; + flatTeams.append(team); + } + + // Sort teams so that Free Provisioning teams come last + std::sort(flatTeams.begin(), flatTeams.end(), ::compareProvisioningTeams); + return flatTeams; +} + bool ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) { @@ -1407,25 +1433,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QMap<QString, QString> settings; if (!project->isActiveConfig("no_xcode_development_team")) { - const QSettings xcodeSettings( - QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"), - QSettings::NativeFormat); - const QVariantMap teams = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap(); + const QList<QVariantMap> teams = provisioningTeams(); if (!teams.isEmpty()) { - for (QVariantMap::const_iterator it = teams.begin(), end = teams.end(); it != end; ++it) { - const QVariantMap team = it.value().toMap(); - const QString teamType = team.value(QLatin1String("teamType")).toString(); - - // Skip Company teams because signing permissions may not be available under all - // circumstances for users who are not the Team Agent - if (teamType != QLatin1String("Company")) { - const QString teamId = team.value(QLatin1String("teamID")).toString(); - settings.insert("DEVELOPMENT_TEAM", teamId); - - // first suitable team we found is the one we'll use by default - break; - } - } + // first suitable team we find is the one we'll use by default + settings.insert("DEVELOPMENT_TEAM", + teams.first().value(QLatin1String("teamID")).toString()); } } settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 9e045f91c3..66d16d6068 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -310,6 +310,13 @@ bool QRawFont::operator==(const QRawFont &other) const /*! Returns the ascent of this QRawFont in pixel units. + The ascent of a font is the distance from the baseline to the + highest position characters extend to. In practice, some font + designers break this rule, e.g. when they put more than one accent + on top of a character, or to accommodate an unusual character in + an exotic language, so it is possible (though rare) that this + value will be too small. + \sa QFontMetricsF::ascent() */ qreal QRawFont::ascent() const @@ -320,6 +327,11 @@ qreal QRawFont::ascent() const /*! Returns the descent of this QRawFont in pixel units. + The descent is the distance from the base line to the lowest point + characters extend to. In practice, some font designers break this rule, + e.g. to accommodate an unusual character in an exotic language, so + it is possible (though rare) that this value will be too small. + \sa QFontMetricsF::descent() */ qreal QRawFont::descent() const @@ -330,6 +342,8 @@ qreal QRawFont::descent() const /*! Returns the xHeight of this QRawFont in pixel units. + This is often but not always the same as the height of the character 'x'. + \sa QFontMetricsF::xHeight() */ qreal QRawFont::xHeight() const @@ -340,6 +354,8 @@ qreal QRawFont::xHeight() const /*! Returns the leading of this QRawFont in pixel units. + This is the natural inter-line spacing. + \sa QFontMetricsF::leading() */ qreal QRawFont::leading() const |