summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/component.cpp
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-09-10 15:38:17 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-09-10 15:38:17 +0300
commit41865907dae243fc5508ec4df35a98317cfb817c (patch)
tree4b2bf862319573c9ac8a3fa1603e06f7cda3ae7b /src/libs/installer/component.cpp
parentbfa8427531cf871b7423c252f522b7bfe75c7edd (diff)
parent08e82c7f25401770fcd293d0bae1c08db30abf7d (diff)
Merge remote-tracking branch 'origin/4.1' into master
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r--src/libs/installer/component.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index d50c36c61..6e3856502 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -45,6 +45,7 @@
#include <QtCore/QDirIterator>
#include <QtCore/QRegExp>
#include <QtCore/QTranslator>
+#include <QtCore/QRegularExpression>
#include <QApplication>
@@ -1309,6 +1310,8 @@ bool Component::validatePage()
/*!
Adds the component specified by \a newDependency to the list of dependencies.
+ Alternatively, multiple components can be specified by separating each with
+ a comma.
\sa {component::addDependency}{component.addDependency}
\sa dependencies
@@ -1330,6 +1333,8 @@ QStringList Component::dependencies() const
/*!
Adds the component specified by \a newDependOn to the automatic depend-on list.
+ Alternatively, multiple components can be specified by separating each with
+ a comma.
\sa {component::addAutoDependOn}{component.addAutoDependOn}
\sa autoDependencies
@@ -1639,26 +1644,23 @@ void Component::updateModelData(const QString &key, const QString &data)
setData(humanReadableSize(size), UncompressedSize);
}
+ QString tooltipText;
const QString &updateInfo = d->m_vars.value(scUpdateText);
if (!d->m_core->isUpdater() || updateInfo.isEmpty()) {
- QString tooltipText
- = QString::fromLatin1("<html><body>%1</body></html>").arg(d->m_vars.value(scDescription));
- if (isUnstable()) {
- tooltipText += QLatin1String("<br>") + tr("There was an error loading the selected component. "
- "This component cannot be installed.");
- }
- setData(tooltipText, Qt::ToolTipRole);
+ tooltipText = QString::fromLatin1("<html><body>%1</body></html>").arg(d->m_vars.value(scDescription));
} else {
- QString tooltipText
- = d->m_vars.value(scDescription) + QLatin1String("<br><br>")
- + tr("Update Info: ") + updateInfo;
- if (isUnstable()) {
- tooltipText += QLatin1String("<br>") + tr("There was an error loading the selected component. "
- "This component cannot be updated.");
- }
-
- setData(tooltipText, Qt::ToolTipRole);
+ tooltipText = d->m_vars.value(scDescription) + QLatin1String("<br><br>")
+ + tr("Update Info: ") + updateInfo;
}
+ if (isUnstable()) {
+ tooltipText += QLatin1String("<br>") + tr("There was an error loading the selected component. "
+ "This component cannot be installed.");
+ }
+ // replace {external-link}='' fields in component description with proper link tags
+ tooltipText.replace(QRegularExpression(QLatin1String("{external-link}='(.*?)'")),
+ QLatin1String("<a href=\"\\1\">\\1</a>"));
+
+ setData(tooltipText, Qt::ToolTipRole);
}
/*!