forked from qt-creator/qt-creator
CMakeProjectManager: Move some markup out of translated strings
Eases the pain of translators. Change-Id: I7327958ee0628698ab326b3c8d6518d3330b83dd Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -30,7 +30,6 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
@@ -602,7 +601,7 @@ QVariant ConfigModelTreeItem::data(int column, int role) const
|
|||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
if (column == 0)
|
if (column == 0)
|
||||||
return dataItem->key.isEmpty()
|
return dataItem->key.isEmpty()
|
||||||
? QCoreApplication::translate("CMakeProjectManager::ConfigModel", "<UNSET>")
|
? ConfigModel::tr("<UNSET>")
|
||||||
: dataItem->key;
|
: dataItem->key;
|
||||||
return value;
|
return value;
|
||||||
case Qt::EditRole:
|
case Qt::EditRole:
|
||||||
@@ -688,33 +687,28 @@ QString ConfigModelTreeItem::toolTip() const
|
|||||||
if (!dataItem->description.isEmpty())
|
if (!dataItem->description.isEmpty())
|
||||||
tooltip << dataItem->description;
|
tooltip << dataItem->description;
|
||||||
|
|
||||||
|
const QString pattern = "<p><b>%1</b> %2</p>";
|
||||||
if (dataItem->isInitial) {
|
if (dataItem->isInitial) {
|
||||||
if (!dataItem->kitValue.isEmpty())
|
if (!dataItem->kitValue.isEmpty())
|
||||||
tooltip << QCoreApplication::translate("CMakeProjectManager", "<p>Kit: <b>%1</b></p>")
|
tooltip << pattern.arg(ConfigModel::tr("Kit:")).arg(dataItem->kitValue);
|
||||||
.arg(dataItem->kitValue);
|
|
||||||
|
|
||||||
tooltip << QCoreApplication::translate("CMakeProjectManager",
|
tooltip << pattern.arg(ConfigModel::tr("Initial Configuration:")).arg(dataItem->currentValue());
|
||||||
"<p>Initial Configuration: <b>%1</b></p>")
|
|
||||||
.arg(dataItem->currentValue());
|
|
||||||
} else {
|
} else {
|
||||||
if (!dataItem->initialValue.isEmpty())
|
if (!dataItem->initialValue.isEmpty()) {
|
||||||
tooltip << QCoreApplication::translate("CMakeProjectManager",
|
tooltip << pattern.arg(ConfigModel::tr("Initial Configuration:"))
|
||||||
"<p>Initial Configuration: <b>%1</b></p>")
|
|
||||||
.arg(dataItem->initialValue);
|
.arg(dataItem->initialValue);
|
||||||
|
}
|
||||||
|
|
||||||
if (dataItem->inCMakeCache) {
|
if (dataItem->inCMakeCache) {
|
||||||
tooltip << QCoreApplication::translate("CMakeProjectManager",
|
tooltip << pattern.arg(ConfigModel::tr("Current Configuration:"))
|
||||||
"<p>Current Configuration: <b>%1</b></p>")
|
|
||||||
.arg(dataItem->currentValue());
|
.arg(dataItem->currentValue());
|
||||||
} else {
|
} else {
|
||||||
tooltip << QCoreApplication::translate("CMakeProjectManager",
|
tooltip << pattern.arg(ConfigModel::tr("Not in CMakeCache.txt")).arg(QString());
|
||||||
"<p>Not in CMakeCache.txt</p>");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tooltip << QCoreApplication::translate("CMakeProjectManager",
|
tooltip << pattern.arg(ConfigModel::tr("Type:")).arg(dataItem->typeDisplay());
|
||||||
"<p>Type: <b>%1</b></p>")
|
|
||||||
.arg(dataItem->typeDisplay());
|
return tooltip.join(QString());
|
||||||
return tooltip.join("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ConfigModelTreeItem::currentValue() const
|
QString ConfigModelTreeItem::currentValue() const
|
||||||
|
|||||||
Reference in New Issue
Block a user