diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-03-02 15:55:29 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-03-02 15:55:29 +0100 |
commit | 994a68280e86f51f0222bb47eaf18b3a82ecc1e8 (patch) | |
tree | e4e5a5a76ec8cd016fdc958fa696cf8c92fa884a | |
parent | fec6bb6c2fb315a859a676ea12f65cf14d29a201 (diff) | |
parent | 8673aae986a3028f5f9dacd15dd77f0d35d2c281 (diff) | |
download | qt-creator-994a68280e86f51f0222bb47eaf18b3a82ecc1e8.tar.gz |
Merge remote-tracking branch 'origin/4.5' into 4.6
Change-Id: Iaf254ce5bc895c703aa6772b4aaa139e531696f6
-rw-r--r-- | qbs/modules/pluginjson/pluginjson.qbs | 30 | ||||
-rw-r--r-- | src/libs/extensionsystem/plugindetailsview.cpp | 17 | ||||
-rw-r--r-- | src/libs/utils/fadingindicator.cpp | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/progressmanager/futureprogress.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/buildstepspage.cpp | 2 |
5 files changed, 48 insertions, 5 deletions
diff --git a/qbs/modules/pluginjson/pluginjson.qbs b/qbs/modules/pluginjson/pluginjson.qbs index 03bdb0b076..8cba183437 100644 --- a/qbs/modules/pluginjson/pluginjson.qbs +++ b/qbs/modules/pluginjson/pluginjson.qbs @@ -1,11 +1,37 @@ import qbs 1.0 -import qbs.TextFile +import qbs.File import qbs.FileInfo +import qbs.TextFile +import qbs.Utilities Module { Depends { id: qtcore; name: "Qt.core" } Depends { name: "qtc" } + // TODO: Wrap the VCS specific stuff in a dedicated module + property bool hasVcs: Utilities.versionCompare(qbs.version, "1.10") >= 0 + Depends { name: "vcs"; condition: hasVcs } + Properties { + condition: hasVcs + vcs.repoDir: { + // TODO: Could something like this be incorporated into the vcs module? + // Currently, the default repo dir is project.sourceDirectory, which + // does not make sense for Qt Creator. + var dir = sourceDirectory; + while (true) { + if (File.exists(FileInfo.joinPaths(dir, ".git"))) + return dir; + var newDir = FileInfo.path(dir); + if (newDir === dir || dir === project.sourceDirectory) { + console.warn("No git repository found for product " + product.name + + ", revision information will not be evailable."); + break; + } + dir = newDir; + } + } + } + additionalProductTypes: ["qt_plugin_metadata"] Rule { @@ -56,6 +82,8 @@ Module { vars['IDE_VERSION_RELEASE'] = product.moduleProperty("qtc", "ide_version_release"); vars['QTCREATOR_COPYRIGHT_YEAR'] = product.moduleProperty("qtc", "qtcreator_copyright_year") + if (!vars['QTC_PLUGIN_REVISION']) + vars['QTC_PLUGIN_REVISION'] = product.vcs ? (product.vcs.repoState || "") : ""; var deplist = []; for (i in plugin_depends) { deplist.push(" { \"Name\" : \"" + plugin_depends[i] + "\", \"Version\" : \"" + qtcVersion + "\" }"); diff --git a/src/libs/extensionsystem/plugindetailsview.cpp b/src/libs/extensionsystem/plugindetailsview.cpp index 5d51a1e31d..13f24d3889 100644 --- a/src/libs/extensionsystem/plugindetailsview.cpp +++ b/src/libs/extensionsystem/plugindetailsview.cpp @@ -32,6 +32,8 @@ #include <utils/algorithm.h> #include <QDir> +#include <QJsonObject> +#include <QJsonValue> #include <QRegExp> /*! @@ -65,6 +67,16 @@ PluginDetailsView::~PluginDetailsView() delete m_ui; } +// TODO: make API in PluginSpec +static QString getSpecRevision(PluginSpec *spec) +{ + const QJsonObject metaData = spec->metaData(); + const QJsonValue revision = metaData.value("Revision"); + if (revision.isString()) + return revision.toString(); + return QString(); +} + /*! Reads the given \a spec and displays its values in this PluginDetailsView. @@ -72,7 +84,10 @@ PluginDetailsView::~PluginDetailsView() void PluginDetailsView::update(PluginSpec *spec) { m_ui->name->setText(spec->name()); - m_ui->version->setText(spec->version()); + const QString revision = getSpecRevision(spec); + const QString versionString = spec->version() + (revision.isEmpty() ? QString() + : " (" + revision + ")"); + m_ui->version->setText(versionString); m_ui->compatVersion->setText(spec->compatVersion()); m_ui->vendor->setText(spec->vendor()); const QString link = QString::fromLatin1("<a href=\"%1\">%1</a>").arg(spec->url()); diff --git a/src/libs/utils/fadingindicator.cpp b/src/libs/utils/fadingindicator.cpp index 6799465829..a9718c9118 100644 --- a/src/libs/utils/fadingindicator.cpp +++ b/src/libs/utils/fadingindicator.cpp @@ -49,7 +49,7 @@ public: { m_effect = new QGraphicsOpacityEffect(this); setGraphicsEffect(m_effect); - m_effect->setOpacity(1.); + m_effect->setOpacity(.999); m_label = new QLabel; QFont font = m_label->font(); diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.cpp b/src/plugins/coreplugin/progressmanager/futureprogress.cpp index 938570c5e4..b06670c656 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/futureprogress.cpp @@ -371,7 +371,7 @@ void FutureProgressPrivate::fadeAway() m_isFading = true; QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect; - opacityEffect->setOpacity(1.); + opacityEffect->setOpacity(.999); m_q->setGraphicsEffect(opacityEffect); QSequentialAnimationGroup *group = new QSequentialAnimationGroup(this); diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 70eecbec88..6b6b6af6bb 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -51,7 +51,7 @@ using namespace ProjectExplorer::Internal; using namespace Utils; ToolWidget::ToolWidget(QWidget *parent) : FadingPanel(parent), - m_targetOpacity(1.0f) + m_targetOpacity(.999) { auto layout = new QHBoxLayout; layout->setMargin(4); |