forked from qt-creator/qt-creator
Proliferate Tr::tr in various places
This changes several tr() calls which were either missed during Tr::tr- ization or were added later. Found with regular expression: (?<!(Tr::)|([\w]))tr\( Change-Id: I1c0c03589e941614a7a8449ecfebc7d2cad396c3 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -23,12 +23,14 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <tracing/timelineformattime.h>
|
||||
#include "quick3dframemodel.h"
|
||||
#include "quick3dmodel.h"
|
||||
#include "qmlprofilermodelmanager.h"
|
||||
#include "qmlprofilerconstants.h"
|
||||
|
||||
#include "qmlprofilerconstants.h"
|
||||
#include "qmlprofilermodelmanager.h"
|
||||
#include "qmlprofilertr.h"
|
||||
#include "quick3dmodel.h"
|
||||
|
||||
#include <tracing/timelineformattime.h>
|
||||
|
||||
namespace QmlProfiler {
|
||||
namespace Internal {
|
||||
@@ -234,19 +236,19 @@ QVariant Quick3DFrameModel::headerData(int section, Qt::Orientation orientation,
|
||||
case Qt::DisplayRole:
|
||||
switch (section) {
|
||||
case Frame:
|
||||
result = QVariant::fromValue(tr("Frame"));
|
||||
result = QVariant::fromValue(Tr::tr("Frame"));
|
||||
break;
|
||||
case Duration:
|
||||
result = QVariant::fromValue(tr("Duration"));
|
||||
result = QVariant::fromValue(Tr::tr("Duration"));
|
||||
break;
|
||||
case Timestamp:
|
||||
result = QVariant::fromValue(tr("Timestamp"));
|
||||
result = QVariant::fromValue(Tr::tr("Timestamp"));
|
||||
break;
|
||||
case FrameDelta:
|
||||
result = QVariant::fromValue(tr("Frame Delta"));
|
||||
result = QVariant::fromValue(Tr::tr("Frame Delta"));
|
||||
break;
|
||||
case View3D:
|
||||
result = QVariant::fromValue(tr("View3D"));
|
||||
result = QVariant::fromValue(Tr::tr("View3D"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -441,7 +443,7 @@ QList<int> Quick3DFrameModel::frameIndices(const QString &view3DFilter) const
|
||||
{
|
||||
QList<int> ret;
|
||||
int key = -1;
|
||||
if (view3DFilter != tr("All")) {
|
||||
if (view3DFilter != Tr::tr("All")) {
|
||||
for (int v3d : m_frameTimes.keys()) {
|
||||
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3DFilter) {
|
||||
key = v3d;
|
||||
@@ -463,17 +465,17 @@ QStringList Quick3DFrameModel::frameNames(const QString &view3D) const
|
||||
QStringList ret;
|
||||
for (auto index : indices) {
|
||||
const Item &item = m_data[index];
|
||||
ret << QString(tr("Frame") + QLatin1Char(' ') + QString::number(item.data));
|
||||
ret << QString(Tr::tr("Frame") + QLatin1Char(' ') + QString::number(item.data));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Quick3DFrameModel::setFilterFrame(const QString &frame)
|
||||
{
|
||||
if (frame == tr("None")) {
|
||||
if (frame == Tr::tr("None")) {
|
||||
m_filterFrame = -1;
|
||||
} else {
|
||||
QString title = tr("Frame");
|
||||
QString title = Tr::tr("Frame");
|
||||
QString number = frame.right(frame.length() - title.length());
|
||||
m_filterFrame = number.toInt();
|
||||
}
|
||||
@@ -482,7 +484,7 @@ void Quick3DFrameModel::setFilterFrame(const QString &frame)
|
||||
void Quick3DFrameModel::setFilterView3D(const QString &view3D)
|
||||
{
|
||||
int key = -1;
|
||||
if (view3D != tr("All")) {
|
||||
if (view3D != Tr::tr("All")) {
|
||||
for (int v3d : m_frameTimes.keys()) {
|
||||
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3D) {
|
||||
key = v3d;
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#include "quick3dframeview.h"
|
||||
|
||||
#include "qmlprofilertr.h"
|
||||
|
||||
#include <coreplugin/minisplitter.h>
|
||||
|
||||
#include <QHeaderView>
|
||||
@@ -41,7 +43,7 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
|
||||
: QmlProfilerEventsView(parent)
|
||||
{
|
||||
setObjectName(QLatin1String("QmlProfiler.Quick3DFrame.Dock"));
|
||||
setWindowTitle(tr("Quick3D Frame"));
|
||||
setWindowTitle(Tr::tr("Quick3D Frame"));
|
||||
|
||||
auto model = new Quick3DFrameModel(profilerModelManager);
|
||||
m_mainView.reset(new Quick3DMainView(model, false, this));
|
||||
@@ -65,8 +67,8 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
|
||||
auto view3DComboModel = new QStringListModel(this);
|
||||
auto frameComboBox = new QComboBox(this);
|
||||
auto frameComboModel = new QStringListModel(this);
|
||||
auto selectView3DLabel = new QLabel(tr("Select View3D"), this);
|
||||
auto selectFrameLabel = new QLabel(tr("Compare Frame"), this);
|
||||
auto selectView3DLabel = new QLabel(Tr::tr("Select View3D"), this);
|
||||
auto selectFrameLabel = new QLabel(Tr::tr("Compare Frame"), this);
|
||||
view3DComboBox->setModel(view3DComboModel);
|
||||
frameComboBox->setModel(frameComboModel);
|
||||
hFrameLayout->addWidget(selectView3DLabel);
|
||||
@@ -79,19 +81,19 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
|
||||
groupLayout->addLayout(hMainLayout);
|
||||
connect(model, &Quick3DFrameModel::modelReset, [model, view3DComboModel, frameComboModel](){
|
||||
QStringList list;
|
||||
list << tr("All");
|
||||
list << Tr::tr("All");
|
||||
list << model->view3DNames();
|
||||
view3DComboModel->setStringList(list);
|
||||
list.clear();
|
||||
list << tr("None");
|
||||
list << model->frameNames(tr("All"));
|
||||
list << Tr::tr("None");
|
||||
list << model->frameNames(Tr::tr("All"));
|
||||
frameComboModel->setStringList(list);
|
||||
});
|
||||
connect(view3DComboBox, &QComboBox::currentTextChanged, [this, model, frameComboModel](const QString &text){
|
||||
m_mainView->setFilterView3D(text);
|
||||
model->setFilterView3D(text);
|
||||
QStringList list;
|
||||
list << tr("None");
|
||||
list << Tr::tr("None");
|
||||
list << model->frameNames(text);
|
||||
frameComboModel->setStringList(list);
|
||||
});
|
||||
@@ -158,7 +160,7 @@ Quick3DMainView::Quick3DMainView(Quick3DFrameModel *model, bool compareView, QWi
|
||||
|
||||
void Quick3DMainView::setFilterView3D(const QString &objectName)
|
||||
{
|
||||
if (objectName == tr("All"))
|
||||
if (objectName == Tr::tr("All"))
|
||||
m_sortModel->setFilterFixedString("");
|
||||
else
|
||||
m_sortModel->setFilterFixedString(objectName);
|
||||
|
||||
@@ -166,8 +166,8 @@ QVariantMap Quick3DModel::details(int index) const
|
||||
if ((detailType == RenderPass || detailType == PrepareFrame) && m_data[index].data) {
|
||||
quint32 width = m_data[index].data & 0xffffffff;
|
||||
quint32 height = m_data[index].data >> 32;
|
||||
result.insert(tr("Width"), width);
|
||||
result.insert(tr("Height"), height);
|
||||
result.insert(Tr::tr("Width"), width);
|
||||
result.insert(Tr::tr("Height"), height);
|
||||
}
|
||||
if ((detailType >= MeshLoad && detailType <= TextureLoad)
|
||||
|| (detailType >= MeshMemoryConsumption && detailType <= TextureMemoryConsumption)) {
|
||||
@@ -176,9 +176,9 @@ QVariantMap Quick3DModel::details(int index) const
|
||||
if (detailType == RenderCall) {
|
||||
quint32 primitives = m_data[index].data & 0xffffffff;
|
||||
quint32 instances = m_data[index].data >> 32;
|
||||
result.insert(tr("Primitives"), primitives);
|
||||
result.insert(Tr::tr("Primitives"), primitives);
|
||||
if (instances > 1)
|
||||
result.insert(tr("Instances"), instances);
|
||||
result.insert(Tr::tr("Instances"), instances);
|
||||
}
|
||||
if (!m_data[index].eventData.isEmpty()) {
|
||||
for (int i = 0; i < m_data[index].eventData.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user