diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts
index 06e5f93e8b7..7096bfcb714 100644
--- a/share/qtcreator/translations/qtcreator_de.ts
+++ b/share/qtcreator/translations/qtcreator_de.ts
@@ -43286,7 +43286,7 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
- PerfProfiler::Internal::PerfConfigWidget
+ PerfProfiler
Stack snapshot size (kB):
Größe des Stack-Abbilds (kB):
@@ -43363,9 +43363,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
Sample period:
Aufnahmehäufigkeit:
-
-
- PerfProfiler::Internal::PerfLoadDialog
Load Perf Trace
Perf-Trace laden
@@ -43402,9 +43399,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
Directory of &executable:
Verzeichnis der &ausführbaren Datei:
-
-
- PerfProfilerFlameGraphView
Samples
Samples
@@ -43445,9 +43439,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
Various
Verschiedene
-
-
- PerfProfiler::Internal::PerfTracePointDialog
Run the following script as root to create trace points?
Soll das folgende Skript als root ausgeführt werden, um Tracepoints zu erzeugen?
@@ -43925,7 +43916,7 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
- PerfProfiler::Internal::PerfConfigEventsModel
+ PerfProfiler
Event Type
Ereignistyp
@@ -43942,9 +43933,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
Result
Ergebnis
-
-
- PerfProfiler::Internal::PerfDataReader
Perf Data Parser Failed
Perf-Daten konnten nicht ausgewertet werden
@@ -43989,31 +43977,18 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
The Perf data parser does not accept further input. Your trace is incomplete.
Der Perf Daten-Parser nimmt keine weiteren Eingabedaten an. Ihr Trace ist unvollständig.
-
-
- PerfProfiler::PerfOptionsPage
CPU Usage
Prozessorauslastung
-
-
- PerfProfiler::Internal::PerfProfilerFlameGraphModel
[unknown]
[unbekannt]
-
-
- PerfProfilerStatisticsView
Address
Adresse
-
- Function
- Funktion
-
Source Location
Position im Quelltext
@@ -44042,10 +44017,6 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
Recursion in Percent
Rekursion in Prozent
-
- Samples
- Samples
-
Samples in Percent
Samples in Prozent
@@ -44506,7 +44477,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
- PerfProfiler::Internal::PerfProfilerRunner
+ PerfProfiler
Failed to transfer Perf data to perfparser.
Perf-Daten konnten nicht zum perfparser übertragen werden.
@@ -44543,7 +44514,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
- PerfProfiler::Internal::LocalPerfRecordWorker
+ PerfProfiler
Could not start device process.
Der Prozess auf dem Gerät konnte nicht gestartet werden.
@@ -44556,9 +44527,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
Make sure that you are running a recent Linux kernel and that the "perf" utility is available.
Stellen Sie sicher, dass Sie einen aktuellen Linux-Kernel verwenden und das Programm "perf" verfügbar ist.
-
-
- PerfProfiler::Internal::PerfProfilerTool
Performance Analyzer Options
Einstellungen zur Leistungsanalyse
@@ -44679,9 +44647,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
Processing delay: %1.%2s
Verarbeitungsverzögerung: %1,%2s
-
-
- PerfProfiler::Internal::PerfProfilerTraceManager
Thread started
Thread gestartet
@@ -44710,24 +44675,14 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
Saving Trace Data
Speichere Trace-Daten
-
-
- PerfProfiler::PerfRunConfigurationAspect
Performance Analyzer Settings
Einstellungen zur Leistungsanalyse
-
-
- PerfProfiler::Internal::PerfTimelineModel
sample collected
Sample aufgezeichnet
-
- [unknown]
- [unbekannt]
-
Details
Details
@@ -44772,26 +44727,10 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e
Duration
Dauer
-
- Samples
- Samples
-
-
- Binary
- Binärdatei
-
(guessed from context)
(aus dem Kontext geschlossen)
-
- Address
- Adresse
-
-
- Source
- Quelltext
-
Total Samples
Samples insgesamt
diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts
index a6c22c8b34b..f32b8a9b3e8 100644
--- a/share/qtcreator/translations/qtcreator_hr.ts
+++ b/share/qtcreator/translations/qtcreator_hr.ts
@@ -5455,7 +5455,7 @@ Greška: %5
- PerfProfiler::Internal::PerfConfigWidget
+ PerfProfiler
Stack snapshot size (kB):
@@ -5532,9 +5532,6 @@ Greška: %5
"perf probe -l" failed to start. Is perf installed?
-
-
- PerfProfiler::Internal::PerfLoadDialog
Load Perf Trace
@@ -5571,9 +5568,6 @@ Greška: %5
Choose Directory of Executable
Odaberi direktorij ili izvršavajuće
-
-
- PerfProfilerFlameGraphView
Samples
Primjeri
@@ -5614,9 +5608,6 @@ Greška: %5
Various
Razno
-
-
- PerfProfiler::Internal::PerfTracePointDialog
Creating Memory Trace Points
@@ -28722,7 +28713,7 @@ Rok upotrebe: %3
- PerfProfiler::Internal::PerfConfigEventsModel
+ PerfProfiler
Event Type
Vrsta događaja
@@ -28739,9 +28730,6 @@ Rok upotrebe: %3
Result
Rezultat
-
-
- PerfProfiler::Internal::PerfDataReader
Perf Data Parser Failed
@@ -28786,23 +28774,14 @@ Rok upotrebe: %3
The Perf data parser does not accept further input. Your trace is incomplete.
-
-
- PerfProfiler::PerfOptionsPage
CPU Usage
Korištenje CPU-a
-
-
- PerfProfiler::Internal::PerfProfilerFlameGraphModel
[unknown]
[nepoznato]
-
-
- PerfProfiler::Internal::LocalPerfRecordWorker
Could not start device process.
Nije bilo moguće pokrenuti proces uređaja.
@@ -28815,24 +28794,14 @@ Rok upotrebe: %3
Make sure that you are running a recent Linux kernel and that the "perf" utility is available.
Provjeri, da pokrećeš najnoviji Linux kernel i da je uslužni program "perf" dostupan.
-
-
- PerfProfiler::Internal::PerfProfilerRunner
Failed to transfer Perf data to perfparser.
Neuspjelo prenošenje Perf podataka na perfparser.
-
-
- PerfProfilerStatisticsView
Address
Adresa
-
- Function
- Funkcija
-
Source Location
Mjesto izvora
@@ -28861,10 +28830,6 @@ Rok upotrebe: %3
Recursion in Percent
Rekurzije u postocima
-
- Samples
- Primjeri
-
Samples in Percent
Primjeri u postocima
@@ -28877,9 +28842,6 @@ Rok upotrebe: %3
Self in Percent
-
-
- PerfProfiler::Internal::PerfProfilerTool
Performance Analyzer Options
Opcije analizatora preformance
@@ -29008,9 +28970,6 @@ Rok upotrebe: %3
Processing delay: %1.%2s
Obrađivanje kašnjenja: %1.%2s
-
-
- PerfProfiler::Internal::PerfProfilerTraceFile
Invalid data format
Neispravni format podataka
@@ -29048,7 +29007,7 @@ Rok upotrebe: %3
- PerfProfiler::Internal::PerfProfilerTraceManager
+ PerfProfiler
Thread started
@@ -29073,24 +29032,14 @@ Rok upotrebe: %3
Saving Trace Data
Spremanje Trace podataka
-
-
- PerfProfiler::PerfRunConfigurationAspect
Performance Analyzer Settings
Postavke za analizatora preformance
-
-
- PerfProfiler::Internal::PerfTimelineModel
sample collected
primjer prikupljen
-
- [unknown]
- [nepoznato]
-
Details
Detalji
@@ -29147,26 +29096,10 @@ Rok upotrebe: %3
Duration
Trajanje
-
- Samples
- Primjeri
-
-
- Binary
- Binarno
-
(guessed from context)
(procijenjeno iz konteksta)
-
- Address
- Adresa
-
-
- Source
- Izvor
-
Total Samples
Ukupno primjera
diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts
index 65e5a89cb18..49ae3802b4c 100644
--- a/share/qtcreator/translations/qtcreator_ja.ts
+++ b/share/qtcreator/translations/qtcreator_ja.ts
@@ -47617,7 +47617,7 @@ Output:
- PerfProfiler::Internal::PerfConfigWidget
+ PerfProfiler
Additional arguments:
追加の引数:
@@ -47626,9 +47626,6 @@ Output:
Reset
リセット
-
-
- PerfProfiler::Internal::PerfLoadDialog
&Browse...
参照(&B)...
@@ -47887,7 +47884,7 @@ Output:
Tracing
- PerfProfilerFlameGraphView
+ PerfProfiler
Function
関数
@@ -52894,29 +52891,19 @@ Stepping into the module or setting breakpoints by file and line is expected to
- PerfProfiler::Internal::PerfConfigEventsModel
+ PerfProfiler
Result
結果
-
-
- PerfProfiler::Internal::PerfProfilerFlameGraphModel
[unknown]
[不明]
-
-
- PerfProfilerStatisticsView
Address
アドレス
-
- Function
- 関数
-
Caller
呼び出し元
@@ -52929,9 +52916,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
Occurrences
出現箇所
-
-
- PerfProfiler::Internal::PerfProfilerTool
Show Full Range
全体を表示
@@ -52964,9 +52948,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
Reset Flame Graph
フレームグラフをリセットする
-
-
- PerfProfiler::Internal::PerfProfilerTraceManager
Invalid
無効
@@ -52979,13 +52960,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
Saving Trace Data
トレースデータの保存中
-
-
- PerfProfiler::Internal::PerfTimelineModel
-
- [unknown]
- [不明]
-
Details
詳細
@@ -53006,18 +52980,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
Duration
持続時間
-
- Binary
- 2進数
-
-
- Address
- アドレス
-
-
- Source
- ソース
-
ProjectExplorer::Internal::AddRunConfigDialog
diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts
index 1e3ee891c7b..fc65c8f4b2d 100644
--- a/share/qtcreator/translations/qtcreator_ru.ts
+++ b/share/qtcreator/translations/qtcreator_ru.ts
@@ -28720,7 +28720,7 @@ If set to false, the target will be moved straight to the current mouse position
- PerfProfiler::Internal::LocalPerfRecordWorker
+ PerfProfiler
Could not start device process.
Не удалось запустить процесс устройства.
@@ -28733,9 +28733,6 @@ If set to false, the target will be moved straight to the current mouse position
Make sure that you are running a recent Linux kernel and that the "perf" utility is available.
Убедитесь, что используете свежую версию ядра Linux, а также в наличии программы «perf».
-
-
- PerfProfiler::Internal::PerfConfigEventsModel
Event Type
Тип события
@@ -28752,9 +28749,6 @@ If set to false, the target will be moved straight to the current mouse position
Result
Результат
-
-
- PerfProfiler::Internal::PerfConfigWidget
Stack snapshot size (kB):
интресно, тут 1000 байт или 1 килобайт?
@@ -28833,9 +28827,6 @@ If set to false, the target will be moved straight to the current mouse position
"perf probe -l" failed to start. Is perf installed?
Не удалось запустить «perf probe -l». Установлен perf?
-
-
- PerfProfiler::Internal::PerfDataReader
Perf Data Parser Failed
Не удалось разобрать данные Perf
@@ -28880,9 +28871,6 @@ If set to false, the target will be moved straight to the current mouse position
The Perf data parser does not accept further input. Your trace is incomplete.
Обработчик данных Perf больше не поддерживает ввод. Трассировка не полная.
-
-
- PerfProfiler::Internal::PerfLoadDialog
Load Perf Trace
Загрузка трассировки Perf
@@ -28919,23 +28907,14 @@ If set to false, the target will be moved straight to the current mouse position
Choose Directory of Executable
Выбор каталога приложения
-
-
- PerfProfiler::Internal::PerfProfilerFlameGraphModel
[unknown]
[неизвестная]
-
-
- PerfProfiler::Internal::PerfProfilerRunner
Failed to transfer Perf data to perfparser.
Не удалось передать данные Perf в perfparser.
-
-
- PerfProfiler::Internal::PerfProfilerTool
Performance Analyzer Options
Параметры анализатора производительности
@@ -29066,9 +29045,6 @@ You might find further explanations in the Application Output view.
Processing delay: %1.%2s
Задержка обработки: %1.%2 сек
-
-
- PerfProfiler::Internal::PerfProfilerTraceFile
Invalid data format. The trace file's identification string is "%1".An acceptable trace file should have "%2". You cannot read trace files generated with older versions of Qt Creator.
Неверный формат данных. У файла трассировки задана строка идентификации «%1». А допустимой является «%2». Нельзя читать файлы трассировки, созданные старыми версиями Qt Creator.
@@ -29077,9 +29053,6 @@ You might find further explanations in the Application Output view.
Invalid data format. The trace file was written with data stream version %1. We can read at most version %2. Please use a newer version of Qt.
Неверный формат данных. Файл трассировки был записан потоком данных версии %1, а поддерживается максимум %2. Используйте более позднюю версию Qt.
-
-
- PerfProfiler::Internal::PerfProfilerTraceManager
Thread started
Поток запущен
@@ -29112,17 +29085,10 @@ You might find further explanations in the Application Output view.
Saving Trace Data
Сохранение данных трассировки
-
-
- PerfProfiler::Internal::PerfTimelineModel
sample collected
сделан семпл
-
- [unknown]
- [неизвестная]
-
Details
Описание
@@ -29211,9 +29177,6 @@ You might find further explanations in the Application Output view.
Resource Guesses
Оценка ресурсов
-
-
- PerfProfiler::Internal::PerfTracePointDialog
Creating Memory Trace Points
Создание точек трассировки памяти
@@ -29250,39 +29213,18 @@ You might find further explanations in the Application Output view.
Failed to run trace point script: %1
Не удалось запустить скрипт: %1
-
-
- PerfProfiler::PerfOptionsPage
CPU Usage
Загрузка CPU
-
-
- PerfProfiler::PerfRunConfigurationAspect
Performance Analyzer Settings
Настройки анализатора производительности
-
-
- PerfProfilerFlameGraphView
-
- Samples
- Семплы
-
Function
Функция
-
- Source
- Источник
-
-
- Binary
- Двоичный
-
Allocations
Выделений
@@ -29308,17 +29250,10 @@ You might find further explanations in the Application Output view.
Various
Разное
-
-
- PerfProfilerStatisticsView
Address
Адрес
-
- Function
- Функция
-
Source Location
Положение в исходнике
@@ -29347,10 +29282,6 @@ You might find further explanations in the Application Output view.
Recursion in Percent
Рекурсия в процентах
-
- Samples
- Семплы
-
Samples in Percent
Семплы в процентах
diff --git a/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml b/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml
index bb0694ffae8..4f8bf96975a 100644
--- a/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml
+++ b/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml
@@ -24,24 +24,24 @@ FlameGraphView {
]
trRoleNames: [
- PerfProfilerFlameGraphModel.SamplesRole, qsTr("Samples"),
- PerfProfilerFlameGraphModel.FunctionRole, qsTr("Function"),
- PerfProfilerFlameGraphModel.SourceFileRole, qsTr("Source"),
- PerfProfilerFlameGraphModel.ElfFileRole, qsTr("Binary"),
- PerfProfilerFlameGraphModel.ResourceAllocationsRole, qsTr("Allocations"),
- PerfProfilerFlameGraphModel.ObservedResourceAllocationsRole, qsTr(" observed"),
- PerfProfilerFlameGraphModel.LostResourceRequestsRole, qsTr(" guessed"),
- PerfProfilerFlameGraphModel.ResourceReleasesRole, qsTr("Releases"),
- PerfProfilerFlameGraphModel.ObservedResourceReleasesRole, qsTr(" observed"),
- PerfProfilerFlameGraphModel.GuessedResourceReleasesRole, qsTr(" guessed"),
- PerfProfilerFlameGraphModel.ResourcePeakRole, qsTr("Peak Usage")
+ PerfProfilerFlameGraphModel.SamplesRole, qsTranslate("PerfProfiler", "Samples"),
+ PerfProfilerFlameGraphModel.FunctionRole, qsTranslate("PerfProfiler", "Function"),
+ PerfProfilerFlameGraphModel.SourceFileRole, qsTranslate("PerfProfiler", "Source"),
+ PerfProfilerFlameGraphModel.ElfFileRole, qsTranslate("PerfProfiler", "Binary"),
+ PerfProfilerFlameGraphModel.ResourceAllocationsRole, qsTranslate("PerfProfiler", "Allocations"),
+ PerfProfilerFlameGraphModel.ObservedResourceAllocationsRole, qsTranslate("PerfProfiler", " observed"),
+ PerfProfilerFlameGraphModel.LostResourceRequestsRole, qsTranslate("PerfProfiler", " guessed"),
+ PerfProfilerFlameGraphModel.ResourceReleasesRole, qsTranslate("PerfProfiler", "Releases"),
+ PerfProfilerFlameGraphModel.ObservedResourceReleasesRole, qsTranslate("PerfProfiler", " observed"),
+ PerfProfilerFlameGraphModel.GuessedResourceReleasesRole, qsTranslate("PerfProfiler", " guessed"),
+ PerfProfilerFlameGraphModel.ResourcePeakRole, qsTranslate("PerfProfiler", "Peak Usage")
].reduce(toMap, {})
details: function(flameGraph) {
var model = [];
if (!flameGraph.dataValid) {
model.push(trRoleNames[PerfProfilerFlameGraphModel.FunctionRole]);
- model.push(qsTr("Various"));
+ model.push(qsTranslate("PerfProfiler", "Various"));
} else {
function addDetail(role, format) { root.addDetail(role, format, model, flameGraph); }
diff --git a/src/plugins/perfprofiler/perfconfigeventsmodel.cpp b/src/plugins/perfprofiler/perfconfigeventsmodel.cpp
index fe9b92c7de5..534d67d3870 100644
--- a/src/plugins/perfprofiler/perfconfigeventsmodel.cpp
+++ b/src/plugins/perfprofiler/perfconfigeventsmodel.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfconfigeventsmodel.h"
+#include "perfprofilertr.h"
#include
@@ -165,10 +166,10 @@ QVariant PerfConfigEventsModel::headerData(int section, Qt::Orientation orientat
return QVariant();
switch (section) {
- case ColumnEventType: return tr("Event Type");
- case ColumnSubType: return tr("Counter");
- case ColumnOperation: return tr("Operation");
- case ColumnResult: return tr("Result");
+ case ColumnEventType: return Tr::tr("Event Type");
+ case ColumnSubType: return Tr::tr("Counter");
+ case ColumnOperation: return Tr::tr("Operation");
+ case ColumnResult: return Tr::tr("Result");
default: return QVariant();
}
diff --git a/src/plugins/perfprofiler/perfconfigwidget.cpp b/src/plugins/perfprofiler/perfconfigwidget.cpp
index eb99ac60310..1441c305747 100644
--- a/src/plugins/perfprofiler/perfconfigwidget.cpp
+++ b/src/plugins/perfprofiler/perfconfigwidget.cpp
@@ -4,6 +4,7 @@
#include "perfconfigeventsmodel.h"
#include "perfconfigwidget.h"
#include "perfprofilerconstants.h"
+#include "perfprofilertr.h"
#include
@@ -62,20 +63,20 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent)
eventsView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
useTracePointsButton = new QPushButton(this);
- useTracePointsButton->setText(tr("Use Trace Points"));
+ useTracePointsButton->setText(Tr::tr("Use Trace Points"));
useTracePointsButton->setVisible(false);
connect(useTracePointsButton, &QPushButton::pressed,
this, &PerfConfigWidget::readTracePoints);
addEventButton = new QPushButton(this);
- addEventButton->setText(tr("Add Event"));
+ addEventButton->setText(Tr::tr("Add Event"));
connect(addEventButton, &QPushButton::pressed, this, [this]() {
auto model = eventsView->model();
model->insertRow(model->rowCount());
});
removeEventButton = new QPushButton(this);
- removeEventButton->setText(tr("Remove Event"));
+ removeEventButton->setText(Tr::tr("Remove Event"));
connect(removeEventButton, &QPushButton::pressed, this, [this]() {
QModelIndex index = eventsView->currentIndex();
if (index.isValid())
@@ -83,7 +84,7 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, QWidget *parent)
});
resetButton = new QPushButton(this);
- resetButton->setText(tr("Reset"));
+ resetButton->setText(Tr::tr("Reset"));
connect(resetButton, &QPushButton::pressed, m_settings, &PerfSettings::resetToDefault);
using namespace Layouting;
@@ -141,9 +142,9 @@ void PerfConfigWidget::apply()
void PerfConfigWidget::readTracePoints()
{
QMessageBox messageBox;
- messageBox.setWindowTitle(tr("Use Trace Points"));
+ messageBox.setWindowTitle(Tr::tr("Use Trace Points"));
messageBox.setIcon(QMessageBox::Question);
- messageBox.setText(tr("Replace events with trace points read from the device?"));
+ messageBox.setText(Tr::tr("Replace events with trace points read from the device?"));
messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
if (messageBox.exec() == QMessageBox::Yes) {
m_process->start();
@@ -155,8 +156,8 @@ void PerfConfigWidget::handleProcessDone()
{
if (m_process->error() == QProcess::FailedToStart) {
Core::AsynchronousMessageBox::warning(
- tr("Cannot List Trace Points"),
- tr("\"perf probe -l\" failed to start. Is perf installed?"));
+ Tr::tr("Cannot List Trace Points"),
+ Tr::tr("\"perf probe -l\" failed to start. Is perf installed?"));
useTracePointsButton->setEnabled(true);
return;
}
@@ -178,8 +179,8 @@ void PerfConfigWidget::handleProcessDone()
if (tracePoints.isEmpty()) {
Core::AsynchronousMessageBox::warning(
- tr("No Trace Points Found"),
- tr("Trace points can be defined with \"perf probe -a\"."));
+ Tr::tr("No Trace Points Found"),
+ Tr::tr("Trace points can be defined with \"perf probe -a\"."));
} else {
for (const QByteArray &event : qAsConst(tracePoints)) {
int row = model->rowCount();
diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp
index 8e23118866a..1351bc40479 100644
--- a/src/plugins/perfprofiler/perfdatareader.cpp
+++ b/src/plugins/perfprofiler/perfdatareader.cpp
@@ -4,6 +4,7 @@
#include "perfdatareader.h"
#include "perfprofilerconstants.h"
#include "perfprofilerplugin.h"
+#include "perfprofilertr.h"
#include "perfrunconfigurationaspect.h"
#include "perfsettings.h"
#include "perftimelinemodel.h"
@@ -58,9 +59,9 @@ PerfDataReader::PerfDataReader(QObject *parent) :
}
if (exitCode != 0) {
QMessageBox::warning(Core::ICore::dialogParent(),
- tr("Perf Data Parser Failed"),
- tr("The Perf data parser failed to process all the samples. "
- "Your trace is incomplete. The exit code was %1.")
+ Tr::tr("Perf Data Parser Failed"),
+ Tr::tr("The Perf data parser failed to process all the samples. "
+ "Your trace is incomplete. The exit code was %1.")
.arg(exitCode));
}
});
@@ -84,18 +85,18 @@ PerfDataReader::PerfDataReader(QObject *parent) :
connect(&m_input, &QProcess::errorOccurred, this, [this](QProcess::ProcessError e){
switch (e) {
case QProcess::FailedToStart:
- emit processFailed(tr("perfparser failed to start."));
+ emit processFailed(Tr::tr("perfparser failed to start."));
QMessageBox::warning(Core::ICore::dialogParent(),
- tr("Perf Data Parser Failed"),
- tr("Could not start the perfparser utility program. "
- "Make sure a working Perf parser is available at the location "
- "given by the PERFPROFILER_PARSER_FILEPATH environment "
- "variable."));
+ Tr::tr("Perf Data Parser Failed"),
+ Tr::tr("Could not start the perfparser utility program. "
+ "Make sure a working Perf parser is available at the "
+ "location given by the PERFPROFILER_PARSER_FILEPATH "
+ "environment variable."));
break;
case QProcess::Crashed:
QMessageBox::warning(Core::ICore::dialogParent(),
- tr("Perf Data Parser Crashed"),
- tr("This is a bug. Please report it."));
+ Tr::tr("Perf Data Parser Crashed"),
+ Tr::tr("This is a bug. Please report it."));
break;
case QProcess::ReadError:
qWarning() << "Cannot receive data from perfparser";
@@ -186,13 +187,13 @@ void PerfDataReader::triggerRecordingStateChange(bool recording)
static_cast(std::numeric_limits::max())));
Core::FutureProgress *fp = Core::ProgressManager::addTimedTask(
- future(), tr("Skipping Processing Delay"),
+ future(), Tr::tr("Skipping Processing Delay"),
Constants::PerfProfilerTaskSkipDelay, seconds);
fp->setToolTip(recording ?
- tr("Cancel this to ignore the processing delay and immediately "
- "start recording.") :
- tr("Cancel this to ignore the processing delay and immediately "
- "stop recording."));
+ Tr::tr("Cancel this to ignore the processing delay and immediately "
+ "start recording.") :
+ Tr::tr("Cancel this to ignore the processing delay and immediately "
+ "stop recording."));
connect(fp, &Core::FutureProgress::canceled, this, [this, recording]() {
setRecording(recording);
});
@@ -325,9 +326,9 @@ void PerfDataReader::writeChunk()
m_input.kill();
emit finished();
QMessageBox::warning(Core::ICore::dialogParent(),
- tr("Cannot Send Data to Perf Data Parser"),
- tr("The Perf data parser does not accept further input. "
- "Your trace is incomplete."));
+ Tr::tr("Cannot Send Data to Perf Data Parser"),
+ Tr::tr("The Perf data parser does not accept further input. "
+ "Your trace is incomplete."));
}
}
} else if (m_dataFinished && m_input.isWritable()) {
diff --git a/src/plugins/perfprofiler/perfloaddialog.cpp b/src/plugins/perfprofiler/perfloaddialog.cpp
index b1f4e2b34eb..21313ae1710 100644
--- a/src/plugins/perfprofiler/perfloaddialog.cpp
+++ b/src/plugins/perfprofiler/perfloaddialog.cpp
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfloaddialog.h"
-
#include "perfprofilerconstants.h"
+#include "perfprofilertr.h"
#include
#include
@@ -28,20 +28,20 @@ namespace Internal {
PerfLoadDialog::PerfLoadDialog(QWidget *parent)
: QDialog(parent)
{
- setWindowTitle(tr("Load Perf Trace"));
+ setWindowTitle(Tr::tr("Load Perf Trace"));
resize(710, 164);
- auto label1 = new QLabel(tr("&Trace file:"));
+ auto label1 = new QLabel(Tr::tr("&Trace file:"));
m_traceFileLineEdit = new QLineEdit(this);
label1->setBuddy(m_traceFileLineEdit);
- auto browseTraceFileButton = new QPushButton(tr("&Browse..."));
+ auto browseTraceFileButton = new QPushButton(Tr::tr("&Browse..."));
- auto label2 = new QLabel(tr("Directory of &executable:"));
+ auto label2 = new QLabel(Tr::tr("Directory of &executable:"));
m_executableDirLineEdit = new QLineEdit(this);
label2->setBuddy(m_executableDirLineEdit);
- auto browseExecutableDirButton = new QPushButton(tr("B&rowse..."));
+ auto browseExecutableDirButton = new QPushButton(Tr::tr("B&rowse..."));
- auto label3 = new QLabel(tr("Kit:"));
+ auto label3 = new QLabel(Tr::tr("Kit:"));
m_kitChooser = new ProjectExplorer::KitChooser(this);
m_kitChooser->populate();
@@ -90,8 +90,8 @@ ProjectExplorer::Kit *PerfLoadDialog::kit() const
void PerfLoadDialog::on_browseTraceFileButton_pressed()
{
FilePath filePath = FileUtils::getOpenFilePath(
- this, tr("Choose Perf Trace"), {},
- tr("Perf traces (*%1)").arg(Constants::TraceFileExtension));
+ this, Tr::tr("Choose Perf Trace"), {},
+ Tr::tr("Perf traces (*%1)").arg(Constants::TraceFileExtension));
if (filePath.isEmpty())
return;
@@ -101,7 +101,7 @@ void PerfLoadDialog::on_browseTraceFileButton_pressed()
void PerfLoadDialog::on_browseExecutableDirButton_pressed()
{
FilePath filePath = FileUtils::getExistingDirectory(
- this, tr("Choose Directory of Executable"));
+ this, Tr::tr("Choose Directory of Executable"));
if (filePath.isEmpty())
return;
diff --git a/src/plugins/perfprofiler/perfoptionspage.cpp b/src/plugins/perfprofiler/perfoptionspage.cpp
index 2d69318b094..66d334b0ab1 100644
--- a/src/plugins/perfprofiler/perfoptionspage.cpp
+++ b/src/plugins/perfprofiler/perfoptionspage.cpp
@@ -1,10 +1,10 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "perfoptionspage.h"
-
#include "perfconfigwidget.h"
+#include "perfoptionspage.h"
#include "perfprofilerconstants.h"
+#include "perfprofilertr.h"
#include
@@ -14,7 +14,7 @@ namespace Internal {
PerfOptionsPage::PerfOptionsPage(PerfSettings *settings)
{
setId(Constants::PerfSettingsId);
- setDisplayName(QCoreApplication::translate("PerfProfiler::PerfOptionsPage", "CPU Usage"));
+ setDisplayName(Tr::tr("CPU Usage"));
setCategory("T.Analyzer");
setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
diff --git a/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp b/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp
index 19d8f7eb635..0b111c102d0 100644
--- a/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp
+++ b/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfprofilerflamegraphmodel.h"
+#include "perfprofilertr.h"
#include
#include
@@ -143,7 +144,7 @@ int PerfProfilerFlameGraphModel::columnCount(const QModelIndex &parent) const
static const QByteArray &orUnknown(const QByteArray &string)
{
- static const QByteArray unknown = PerfProfilerFlameGraphModel::tr("[unknown]").toUtf8();
+ static const QByteArray unknown = Tr::tr("[unknown]").toUtf8();
return string.isEmpty() ? unknown : string;
}
diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp
index 2bd4a4bd628..3ec2f6b6c19 100644
--- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp
+++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp
@@ -108,10 +108,10 @@ public:
// The terminate() below will frequently lead to QProcess::Crashed. We're not interested
// in that. FailedToStart is the only actual failure.
if (m_process->error() == QProcess::FailedToStart) {
- const QString msg = tr("Perf Process Failed to Start");
+ const QString msg = Tr::tr("Perf Process Failed to Start");
QMessageBox::warning(Core::ICore::dialogParent(), msg,
- tr("Make sure that you are running a recent Linux kernel and "
- "that the \"perf\" utility is available."));
+ Tr::tr("Make sure that you are running a recent Linux kernel "
+ "and that the \"perf\" utility is available."));
reportFailure(msg);
return;
}
@@ -192,7 +192,7 @@ void PerfProfilerRunner::start()
});
connect(recorder, &QtcProcess::readyReadStandardOutput, this, [this, reader, recorder] {
if (!reader->feedParser(recorder->readAllStandardOutput()))
- reportFailure(tr("Failed to transfer Perf data to perfparser."));
+ reportFailure(Tr::tr("Failed to transfer Perf data to perfparser."));
});
}
diff --git a/src/plugins/perfprofiler/perfprofilerstatisticsmodel.cpp b/src/plugins/perfprofiler/perfprofilerstatisticsmodel.cpp
index 0f71b056e4f..c46702c0276 100644
--- a/src/plugins/perfprofiler/perfprofilerstatisticsmodel.cpp
+++ b/src/plugins/perfprofiler/perfprofilerstatisticsmodel.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfprofilerstatisticsmodel.h"
+#include "perfprofilertr.h"
#include
@@ -11,19 +12,19 @@ namespace PerfProfiler {
namespace Internal {
static const char *headerLabels[] = {
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Address"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Function"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Source Location"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Binary Location"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Caller"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Callee"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Occurrences"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Occurrences in Percent"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Recursion in Percent"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Samples"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Samples in Percent"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Self Samples"),
- QT_TRANSLATE_NOOP("PerfProfilerStatisticsView", "Self in Percent")
+ QT_TRANSLATE_NOOP("PerfProfiler", "Address"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Function"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Source Location"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Binary Location"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Caller"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Callee"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Occurrences"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Occurrences in Percent"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Recursion in Percent"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Samples"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Samples in Percent"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Self Samples"),
+ QT_TRANSLATE_NOOP("PerfProfiler", "Self in Percent")
};
Q_STATIC_ASSERT(sizeof(headerLabels) ==
@@ -102,7 +103,7 @@ QVariant PerfProfilerStatisticsModel::headerData(int section, Qt::Orientation or
if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
return QVariant();
- return tr(headerLabels[m_columns[section]]);
+ return Tr::tr(headerLabels[m_columns[section]]);
}
void PerfProfilerStatisticsMainModel::resort()
diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp
index 3388babf3d4..66084dbdca9 100644
--- a/src/plugins/perfprofiler/perfprofilertool.cpp
+++ b/src/plugins/perfprofiler/perfprofilertool.cpp
@@ -64,30 +64,30 @@ PerfProfilerTool::PerfProfilerTool()
m_zoomControl = new Timeline::TimelineZoomControl(this);
ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER);
ActionContainer *options = ActionManager::createMenu(Constants::PerfOptionsMenuId);
- options->menu()->setTitle(tr("Performance Analyzer Options"));
+ options->menu()->setTitle(Tr::tr("Performance Analyzer Options"));
menu->addMenu(options, Debugger::Constants::G_ANALYZER_OPTIONS);
options->menu()->setEnabled(true);
const Core::Context globalContext(Core::Constants::C_GLOBAL);
- m_loadPerfData = new QAction(tr("Load perf.data File"), options);
+ m_loadPerfData = new QAction(Tr::tr("Load perf.data File"), options);
Core::Command *command = Core::ActionManager::registerAction(
m_loadPerfData, Constants::PerfProfilerTaskLoadPerf, globalContext);
connect(m_loadPerfData, &QAction::triggered, this, &PerfProfilerTool::showLoadPerfDialog);
options->addAction(command);
- m_loadTrace = new QAction(tr("Load Trace File"), options);
+ m_loadTrace = new QAction(Tr::tr("Load Trace File"), options);
command = Core::ActionManager::registerAction(m_loadTrace, Constants::PerfProfilerTaskLoadTrace,
globalContext);
connect(m_loadTrace, &QAction::triggered, this, &PerfProfilerTool::showLoadTraceDialog);
options->addAction(command);
- m_saveTrace = new QAction(tr("Save Trace File"), options);
+ m_saveTrace = new QAction(Tr::tr("Save Trace File"), options);
command = Core::ActionManager::registerAction(m_saveTrace, Constants::PerfProfilerTaskSaveTrace,
globalContext);
connect(m_saveTrace, &QAction::triggered, this, &PerfProfilerTool::showSaveTraceDialog);
options->addAction(command);
- m_limitToRange = new QAction(tr("Limit to Range Selected in Timeline"), options);
+ m_limitToRange = new QAction(Tr::tr("Limit to Range Selected in Timeline"), options);
command = Core::ActionManager::registerAction(m_limitToRange, Constants::PerfProfilerTaskLimit,
globalContext);
connect(m_limitToRange, &QAction::triggered, this, [this]() {
@@ -97,7 +97,7 @@ PerfProfilerTool::PerfProfilerTool()
});
options->addAction(command);
- m_showFullRange = new QAction(tr("Show Full Range"), options);
+ m_showFullRange = new QAction(Tr::tr("Show Full Range"), options);
command = Core::ActionManager::registerAction(m_showFullRange,
Constants::PerfProfilerTaskFullRange,
globalContext);
@@ -106,11 +106,11 @@ PerfProfilerTool::PerfProfilerTool()
});
options->addAction(command);
- QAction *tracePointsAction = new QAction(tr("Create Memory Trace Points"), options);
+ QAction *tracePointsAction = new QAction(Tr::tr("Create Memory Trace Points"), options);
tracePointsAction->setIcon(Debugger::Icons::TRACEPOINT_TOOLBAR.icon());
tracePointsAction->setIconVisibleInMenu(false);
- tracePointsAction->setToolTip(tr("Create trace points for memory profiling on the target "
- "device."));
+ tracePointsAction->setToolTip(Tr::tr("Create trace points for memory profiling on the target "
+ "device."));
command = Core::ActionManager::registerAction(tracePointsAction,
Constants::PerfProfilerTaskTracePoints,
globalContext);
@@ -121,8 +121,8 @@ PerfProfilerTool::PerfProfilerTool()
m_tracePointsButton->setDefaultAction(tracePointsAction);
m_objectsToDelete << m_tracePointsButton;
- auto action = new QAction(tr("Performance Analyzer"), this);
- action->setToolTip(tr("Finds performance bottlenecks."));
+ auto action = new QAction(Tr::tr("Performance Analyzer"), this);
+ action->setToolTip(Tr::tr("Finds performance bottlenecks."));
menu->addAction(ActionManager::registerAction(action, Constants::PerfProfilerLocalActionId),
Debugger::Constants::G_ANALYZER_TOOLS);
QObject::connect(action, &QAction::triggered, this, [this] {
@@ -168,15 +168,15 @@ void PerfProfilerTool::createViews()
{
m_objectsToDelete.clear();
m_traceView = new PerfProfilerTraceView(nullptr, this);
- m_traceView->setWindowTitle(tr("Timeline"));
+ m_traceView->setWindowTitle(Tr::tr("Timeline"));
connect(m_traceView, &PerfProfilerTraceView::gotoSourceLocation,
this, &PerfProfilerTool::gotoSourceLocation);
m_statisticsView = new PerfProfilerStatisticsView(nullptr, this);
- m_statisticsView->setWindowTitle(tr("Statistics"));
+ m_statisticsView->setWindowTitle(Tr::tr("Statistics"));
m_flameGraphView = new PerfProfilerFlameGraphView(nullptr, this);
- m_flameGraphView->setWindowTitle(tr("Flame Graph"));
+ m_flameGraphView->setWindowTitle(Tr::tr("Flame Graph"));
connect(m_statisticsView, &PerfProfilerStatisticsView::gotoSourceLocation,
this, &PerfProfilerTool::gotoSourceLocation);
@@ -243,7 +243,7 @@ void PerfProfilerTool::createViews()
connect(m_recordButton, &QAbstractButton::clicked, this, &PerfProfilerTool::setRecording);
m_clearButton->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon());
- m_clearButton->setToolTip(tr("Discard data."));
+ m_clearButton->setToolTip(Tr::tr("Discard data."));
connect(m_clearButton, &QAbstractButton::clicked, this, &PerfProfilerTool::clear);
m_filterButton->setIcon(Utils::Icons::FILTER.icon());
@@ -264,7 +264,7 @@ void PerfProfilerTool::createViews()
connect(m_traceManager, &PerfProfilerTraceManager::error, this, [](const QString &message) {
QMessageBox *errorDialog = new QMessageBox(ICore::dialogParent());
errorDialog->setIcon(QMessageBox::Warning);
- errorDialog->setWindowTitle(tr("Performance Analyzer"));
+ errorDialog->setWindowTitle(Tr::tr("Performance Analyzer"));
errorDialog->setText(message);
errorDialog->setStandardButtons(QMessageBox::Ok);
errorDialog->setDefaultButton(QMessageBox::Ok);
@@ -286,10 +286,10 @@ void PerfProfilerTool::createViews()
QMenu *menu1 = new QMenu(m_traceView);
addLoadSaveActionsToMenu(menu1);
- connect(menu1->addAction(tr("Limit to Selected Range")), &QAction::triggered,
+ connect(menu1->addAction(Tr::tr("Limit to Selected Range")), &QAction::triggered,
m_limitToRange, &QAction::trigger);
menu1->addAction(m_showFullRange);
- connect(menu1->addAction(tr("Reset Zoom")), &QAction::triggered, this, [this](){
+ connect(menu1->addAction(Tr::tr("Reset Zoom")), &QAction::triggered, this, [this](){
m_zoomControl->setRange(m_zoomControl->traceStart(), m_zoomControl->traceEnd());
});
@@ -301,13 +301,13 @@ void PerfProfilerTool::createViews()
menu1 = new QMenu(m_statisticsView);
addLoadSaveActionsToMenu(menu1);
- connect(menu1->addAction(tr("Limit to Range Selected in Timeline")), &QAction::triggered,
+ connect(menu1->addAction(Tr::tr("Limit to Range Selected in Timeline")), &QAction::triggered,
m_limitToRange, &QAction::trigger);
- connect(menu1->addAction(tr("Show Full Range")), &QAction::triggered,
+ connect(menu1->addAction(Tr::tr("Show Full Range")), &QAction::triggered,
m_showFullRange, &QAction::trigger);
- connect(menu1->addAction(tr("Copy Table")), &QAction::triggered,
+ connect(menu1->addAction(Tr::tr("Copy Table")), &QAction::triggered,
m_statisticsView, &PerfProfilerStatisticsView::copyFocusedTableToClipboard);
- QAction *copySelection = menu1->addAction(tr("Copy Row"));
+ QAction *copySelection = menu1->addAction(Tr::tr("Copy Row"));
connect(copySelection, &QAction::triggered,
m_statisticsView, &PerfProfilerStatisticsView::copyFocusedSelectionToClipboard);
m_statisticsView->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -319,11 +319,11 @@ void PerfProfilerTool::createViews()
menu1 = new QMenu(m_flameGraphView);
addLoadSaveActionsToMenu(menu1);
- connect(menu1->addAction(tr("Limit to Range Selected in Timeline")), &QAction::triggered,
+ connect(menu1->addAction(Tr::tr("Limit to Range Selected in Timeline")), &QAction::triggered,
m_limitToRange, &QAction::trigger);
- connect(menu1->addAction(tr("Show Full Range")), &QAction::triggered,
+ connect(menu1->addAction(Tr::tr("Show Full Range")), &QAction::triggered,
m_showFullRange, &QAction::trigger);
- QAction *resetAction = menu1->addAction(tr("Reset Flame Graph"));
+ QAction *resetAction = menu1->addAction(Tr::tr("Reset Flame Graph"));
connect(resetAction, &QAction::triggered,
m_flameGraphView, &PerfProfilerFlameGraphView::resetRoot);
m_flameGraphView->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -398,12 +398,12 @@ void PerfProfilerTool::onReaderFinished()
m_readerRunning = false;
if (m_traceManager->traceDuration() <= 0) {
QMessageBox::warning(Core::ICore::dialogParent(),
- tr("No Data Loaded"),
- tr("The profiler did not produce any samples. "
- "Make sure that you are running a recent Linux kernel and that "
- "the \"perf\" utility is available and generates useful call "
- "graphs.\nYou might find further explanations in the Application "
- "Output view."));
+ Tr::tr("No Data Loaded"),
+ Tr::tr("The profiler did not produce any samples. "
+ "Make sure that you are running a recent Linux kernel and that "
+ "the \"perf\" utility is available and generates useful call "
+ "graphs.\nYou might find further explanations in the "
+ "Application Output view."));
clear();
} else {
m_traceManager->finalize();
@@ -437,11 +437,11 @@ void PerfProfilerTool::updateRunActions()
m_stopAction->setEnabled(m_processRunning);
if (m_readerRunning || m_processRunning) {
m_startAction->setEnabled(false);
- m_startAction->setToolTip(tr("A performance analysis is still in progress."));
+ m_startAction->setToolTip(Tr::tr("A performance analysis is still in progress."));
m_loadPerfData->setEnabled(false);
m_loadTrace->setEnabled(false);
} else {
- QString whyNot = tr("Start a performance analysis.");
+ QString whyNot = Tr::tr("Start a performance analysis.");
bool canRun = ProjectExplorerPlugin::canRunStartupProject(
ProjectExplorer::Constants::PERFPROFILER_RUN_MODE, &whyNot);
m_startAction->setToolTip(whyNot);
@@ -493,8 +493,8 @@ void PerfProfilerTool::updateFilterMenu()
{
m_filterMenu->clear();
- QAction *enableAll = m_filterMenu->addAction(tr("Enable All"));
- QAction *disableAll = m_filterMenu->addAction(tr("Disable All"));
+ QAction *enableAll = m_filterMenu->addAction(Tr::tr("Enable All"));
+ QAction *disableAll = m_filterMenu->addAction(Tr::tr("Disable All"));
m_filterMenu->addSeparator();
QList threads = m_traceManager->threads().values();
@@ -600,8 +600,8 @@ void PerfProfilerTool::showLoadTraceDialog()
{
m_perspective.select();
- FilePath filePath = FileUtils::getOpenFilePath(nullptr, tr("Load Trace File"),
- {}, tr("Trace File (*.ptq)"));
+ FilePath filePath = FileUtils::getOpenFilePath(nullptr, Tr::tr("Load Trace File"),
+ {}, Tr::tr("Trace File (*.ptq)"));
if (filePath.isEmpty())
return;
@@ -619,8 +619,8 @@ void PerfProfilerTool::showSaveTraceDialog()
{
m_perspective.select();
- FilePath filePath = FileUtils::getSaveFilePath(nullptr, tr("Save Trace File"),
- {}, tr("Trace File (*.ptq)"));
+ FilePath filePath = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Trace File"),
+ {}, Tr::tr("Trace File (*.ptq)"));
if (filePath.isEmpty())
return;
if (!filePath.endsWith(".ptq"))
@@ -633,8 +633,8 @@ void PerfProfilerTool::showSaveTraceDialog()
void PerfProfilerTool::setAggregated(bool aggregated)
{
m_aggregateButton->setChecked(aggregated);
- m_aggregateButton->setToolTip(aggregated ? tr("Show all addresses.")
- : tr("Aggregate by functions."));
+ m_aggregateButton->setToolTip(aggregated ? Tr::tr("Show all addresses.")
+ : Tr::tr("Aggregate by functions."));
emit aggregatedChanged(aggregated);
}
@@ -645,8 +645,8 @@ void PerfProfilerTool::setRecording(bool recording)
m_recordButton->setIcon(recording ? recordOn : recordOff);
m_recordButton->setChecked(recording);
- m_recordButton->setToolTip(recording ? tr("Stop collecting profile data.") :
- tr("Collect profile data."));
+ m_recordButton->setToolTip(recording ? Tr::tr("Stop collecting profile data.") :
+ Tr::tr("Collect profile data."));
emit recordingChanged(recording);
}
@@ -654,13 +654,13 @@ void PerfProfilerTool::updateTime(qint64 duration, qint64 delay)
{
qint64 e9 = 1e9, e8 = 1e8, ten = 10; // compiler would cast to double
if (duration > 0)
- m_recordedLabel->setText(tr("Recorded: %1.%2s").arg(duration / e9)
- .arg(qAbs(duration / e8) % ten));
+ m_recordedLabel->setText(Tr::tr("Recorded: %1.%2s").arg(duration / e9)
+ .arg(qAbs(duration / e8) % ten));
else if (duration == 0)
m_recordedLabel->clear();
if (delay > 0)
- m_delayLabel->setText(tr("Processing delay: %1.%2s").arg(delay / e9)
+ m_delayLabel->setText(Tr::tr("Processing delay: %1.%2s").arg(delay / e9)
.arg(qAbs(delay / e8) % ten));
else if (delay == 0)
m_delayLabel->clear();
diff --git a/src/plugins/perfprofiler/perfprofilertool.h b/src/plugins/perfprofiler/perfprofilertool.h
index f68c4ef015d..bfa6598ca0a 100644
--- a/src/plugins/perfprofiler/perfprofilertool.h
+++ b/src/plugins/perfprofiler/perfprofilertool.h
@@ -6,6 +6,7 @@
#include "perfprofilerconstants.h"
#include "perfprofilerflamegraphview.h"
#include "perfprofilerstatisticsview.h"
+#include "perfprofilertr.h"
#include "perfprofilertraceview.h"
#include "perftimelinemodelmanager.h"
@@ -78,7 +79,7 @@ private:
void finalize();
Utils::Perspective m_perspective{Constants::PerfProfilerPerspectiveId,
- tr("Performance Analyzer")};
+ Tr::tr("Performance Analyzer")};
QAction *m_startAction = nullptr;
QAction *m_stopAction = nullptr;
diff --git a/src/plugins/perfprofiler/perfprofilertracefile.cpp b/src/plugins/perfprofiler/perfprofilertracefile.cpp
index 59de026f7ee..5d35a9cc10f 100644
--- a/src/plugins/perfprofiler/perfprofilertracefile.cpp
+++ b/src/plugins/perfprofiler/perfprofilertracefile.cpp
@@ -3,6 +3,7 @@
#include "perfprofilerconstants.h"
#include "perfprofilerplugin.h"
+#include "perfprofilertr.h"
#include "perfprofilertracefile.h"
#include
@@ -246,12 +247,12 @@ void PerfProfilerTraceFile::readFromDevice()
} else if (strncmp(magic.data(), Constants::PerfZqfileMagic, magicSize) == 0) {
m_compressed = true;
} else {
- fail(tr("Invalid data format. The trace file's identification string is \"%1\"."
- "An acceptable trace file should have \"%2\". You cannot read trace files "
- "generated with older versions of %3.")
- .arg(QString::fromLatin1(magic))
- .arg(QString::fromLatin1(Constants::PerfZqfileMagic)
- .arg(Core::Constants::IDE_DISPLAY_NAME)));
+ fail(Tr::tr("Invalid data format. The trace file's identification string is \"%1\"."
+ "An acceptable trace file should have \"%2\". You cannot read trace files "
+ "generated with older versions of %3.")
+ .arg(QString::fromLatin1(magic))
+ .arg(QString::fromLatin1(Constants::PerfZqfileMagic))
+ .arg(Core::Constants::IDE_DISPLAY_NAME));
return;
}
@@ -260,10 +261,10 @@ void PerfProfilerTraceFile::readFromDevice()
if (m_dataStreamVersion < 0
|| m_dataStreamVersion > QDataStream::Qt_DefaultCompiledVersion) {
- fail(tr("Invalid data format. The trace file was written with data stream version %1. "
- "We can read at most version %2. Please use a newer version of Qt.")
- .arg(m_dataStreamVersion)
- .arg(qint32(QDataStream::Qt_DefaultCompiledVersion)));
+ fail(Tr::tr("Invalid data format. The trace file was written with data stream version %1. "
+ "We can read at most version %2. Please use a newer version of Qt.")
+ .arg(m_dataStreamVersion)
+ .arg(qint32(QDataStream::Qt_DefaultCompiledVersion)));
return;
}
}
diff --git a/src/plugins/perfprofiler/perfprofilertracemanager.cpp b/src/plugins/perfprofiler/perfprofilertracemanager.cpp
index 9a2aec9486f..847ac1c4ec6 100644
--- a/src/plugins/perfprofiler/perfprofilertracemanager.cpp
+++ b/src/plugins/perfprofiler/perfprofilertracemanager.cpp
@@ -1,10 +1,11 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "perfprofilertracemanager.h"
-#include "perfprofilertracefile.h"
-#include "perfprofilerconstants.h"
#include "perfdatareader.h"
+#include "perfprofilerconstants.h"
+#include "perfprofilertr.h"
+#include "perfprofilertracefile.h"
+#include "perfprofilertracemanager.h"
#include
#include
@@ -72,13 +73,13 @@ void PerfProfilerEventStorage::clear()
m_file.clear();
m_size = 0;
if (!m_file.open())
- m_errorHandler(tr("Failed to reset temporary trace file."));
+ m_errorHandler(Tr::tr("Failed to reset temporary trace file."));
}
void PerfProfilerEventStorage::finalize()
{
if (!m_file.flush())
- m_errorHandler(tr("Failed to flush temporary trace file."));
+ m_errorHandler(Tr::tr("Failed to flush temporary trace file."));
}
bool PerfProfilerEventStorage::replay(
@@ -88,13 +89,13 @@ bool PerfProfilerEventStorage::replay(
case Timeline::TraceStashFile::ReplaySuccess:
return true;
case Timeline::TraceStashFile::ReplayOpenFailed:
- m_errorHandler(tr("Cannot re-open temporary trace file."));
+ m_errorHandler(Tr::tr("Cannot re-open temporary trace file."));
break;
case Timeline::TraceStashFile::ReplayLoadFailed:
// Happens if the loader rejects an event. Not an actual error
break;
case Timeline::TraceStashFile::ReplayReadPastEnd:
- m_errorHandler(tr("Read past end from temporary trace file."));
+ m_errorHandler(Tr::tr("Read past end from temporary trace file."));
break;
}
return false;
@@ -190,15 +191,15 @@ void PerfProfilerTraceManager::resetAttributes()
{
// The "meta" types are useful and also have to be reported to TimelineTraceManager.
setEventType(PerfEvent::ThreadStartTypeId, PerfEventType(PerfEventType::ThreadStart,
- tr("Thread started")));
+ Tr::tr("Thread started")));
setEventType(PerfEvent::ThreadEndTypeId, PerfEventType(PerfEventType::ThreadEnd,
- tr("Thread ended")));
+ Tr::tr("Thread ended")));
setEventType(PerfEvent::LostTypeId, PerfEventType(PerfEventType::LostDefinition,
- tr("Samples lost")));
+ Tr::tr("Samples lost")));
setEventType(PerfEvent::ContextSwitchTypeId,
- PerfEventType(PerfEventType::ContextSwitchDefinition, tr("Context switch")));
+ PerfEventType(PerfEventType::ContextSwitchDefinition, Tr::tr("Context switch")));
setEventType(PerfEvent::LastSpecialTypeId,
- PerfEventType(PerfEventType::InvalidFeature, tr("Invalid")));
+ PerfEventType(PerfEventType::InvalidFeature, Tr::tr("Invalid")));
}
void PerfProfilerTraceManager::finalize()
@@ -267,7 +268,7 @@ void PerfProfilerTraceManager::replayPerfEvents(PerfEventLoader loader, Initiali
if (!result && errorHandler) {
errorHandler(future.isCanceled() ? QString()
- : tr("Failed to replay Perf events from stash file."));
+ : Tr::tr("Failed to replay Perf events from stash file."));
} else if (result && finalizer) {
finalizer();
}
@@ -576,13 +577,13 @@ qint32 PerfProfilerTraceManager::symbolLocation(qint32 locationId) const
void PerfProfilerTraceManager::loadFromTraceFile(const QString &filePath)
{
- Core::ProgressManager::addTask(load(filePath), tr("Loading Trace Data"),
+ Core::ProgressManager::addTask(load(filePath), Tr::tr("Loading Trace Data"),
Constants::PerfProfilerTaskLoadTrace);
}
void PerfProfilerTraceManager::saveToTraceFile(const QString &filePath)
{
- Core::ProgressManager::addTask(save(filePath), tr("Saving Trace Data"),
+ Core::ProgressManager::addTask(save(filePath), Tr::tr("Saving Trace Data"),
Constants::PerfProfilerTaskSaveTrace);
}
@@ -606,7 +607,7 @@ void PerfProfilerTraceManager::loadFromPerfData(const QString &filePath,
qMin(QFileInfo(filePath).size() >> 20,
static_cast(std::numeric_limits::max())));
Core::FutureProgress *fp = Core::ProgressManager::addTimedTask(
- reader->future(), tr("Loading Trace Data"), Constants::PerfProfilerTaskLoadPerf,
+ reader->future(), Tr::tr("Loading Trace Data"), Constants::PerfProfilerTaskLoadPerf,
fileMegabytes);
connect(fp, &Core::FutureProgress::canceled, reader, [reader]() {
diff --git a/src/plugins/perfprofiler/perfprofilertracemanager.h b/src/plugins/perfprofiler/perfprofilertracemanager.h
index dd0058ffa04..528c44174bb 100644
--- a/src/plugins/perfprofiler/perfprofilertracemanager.h
+++ b/src/plugins/perfprofiler/perfprofilertracemanager.h
@@ -18,7 +18,6 @@ namespace Internal {
class PerfProfilerEventStorage : public Timeline::TraceEventStorage
{
- Q_DECLARE_TR_FUNCTIONS(QmlProfilerEventStorage)
public:
using StashFile = Timeline::TraceStashFile;
diff --git a/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp b/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp
index c5e910790c7..675c925961c 100644
--- a/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp
+++ b/src/plugins/perfprofiler/perfrunconfigurationaspect.cpp
@@ -3,6 +3,7 @@
#include "perfprofilerconstants.h"
#include "perfprofilerplugin.h"
+#include "perfprofilertr.h"
#include "perfrunconfigurationaspect.h"
#include "perfsettings.h"
@@ -15,8 +16,7 @@ PerfRunConfigurationAspect::PerfRunConfigurationAspect(ProjectExplorer::Target *
setProjectSettings(new PerfSettings(target));
setGlobalSettings(Internal::PerfProfilerPlugin::globalSettings());
setId(Constants::PerfSettingsId);
- setDisplayName(QCoreApplication::translate("PerfProfiler::PerfRunConfigurationAspect",
- "Performance Analyzer Settings"));
+ setDisplayName(Tr::tr("Performance Analyzer Settings"));
setUsingGlobalSettings(true);
resetProjectToGlobalSettings();
setConfigWidgetCreator([this] { return new Debugger::AnalyzerRunConfigWidget(this); });
diff --git a/src/plugins/perfprofiler/perfsettings.cpp b/src/plugins/perfprofiler/perfsettings.cpp
index 871f2b076cc..d0ae49e3a5d 100644
--- a/src/plugins/perfprofiler/perfsettings.cpp
+++ b/src/plugins/perfprofiler/perfsettings.cpp
@@ -3,6 +3,7 @@
#include "perfconfigwidget.h"
#include "perfprofilerconstants.h"
+#include "perfprofilertr.h"
#include "perfsettings.h"
#include
@@ -28,29 +29,29 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target)
period.setSettingsKey("Analyzer.Perf.Frequency");
period.setRange(250, 2147483647);
period.setDefaultValue(250);
- period.setLabelText(tr("Sample period:"));
+ period.setLabelText(Tr::tr("Sample period:"));
registerAspect(&stackSize);
stackSize.setSettingsKey("Analyzer.Perf.StackSize");
stackSize.setRange(4096, 65536);
stackSize.setDefaultValue(4096);
- stackSize.setLabelText(tr("Stack snapshot size (kB):"));
+ stackSize.setLabelText(Tr::tr("Stack snapshot size (kB):"));
registerAspect(&sampleMode);
sampleMode.setSettingsKey("Analyzer.Perf.SampleMode");
sampleMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
- sampleMode.setLabelText(tr("Sample mode:"));
- sampleMode.addOption({tr("frequency (Hz)"), {}, QString("-F")});
- sampleMode.addOption({tr("event count"), {}, QString("-c")});
+ sampleMode.setLabelText(Tr::tr("Sample mode:"));
+ sampleMode.addOption({Tr::tr("frequency (Hz)"), {}, QString("-F")});
+ sampleMode.addOption({Tr::tr("event count"), {}, QString("-c")});
sampleMode.setDefaultValue(0);
registerAspect(&callgraphMode);
callgraphMode.setSettingsKey("Analyzer.Perf.CallgraphMode");
callgraphMode.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
- callgraphMode.setLabelText(tr("Call graph mode:"));
- callgraphMode.addOption({tr("dwarf"), {}, QString(Constants::PerfCallgraphDwarf)});
- callgraphMode.addOption({tr("frame pointer"), {}, QString("fp")});
- callgraphMode.addOption({tr("last branch record"), {}, QString("lbr")});
+ callgraphMode.setLabelText(Tr::tr("Call graph mode:"));
+ callgraphMode.addOption({Tr::tr("dwarf"), {}, QString(Constants::PerfCallgraphDwarf)});
+ callgraphMode.addOption({Tr::tr("frame pointer"), {}, QString("fp")});
+ callgraphMode.addOption({Tr::tr("last branch record"), {}, QString("lbr")});
callgraphMode.setDefaultValue(0);
registerAspect(&events);
@@ -60,7 +61,7 @@ PerfSettings::PerfSettings(ProjectExplorer::Target *target)
registerAspect(&extraArguments);
extraArguments.setSettingsKey("Analyzer.Perf.ExtraArguments");
extraArguments.setDisplayStyle(StringAspect::DisplayStyle::LineEditDisplay);
- extraArguments.setLabelText(tr("Additional arguments:"));
+ extraArguments.setLabelText(Tr::tr("Additional arguments:"));
extraArguments.setSpan(4);
connect(&callgraphMode, &SelectionAspect::volatileValueChanged, this, [this](int index) {
diff --git a/src/plugins/perfprofiler/perftimelinemodel.cpp b/src/plugins/perfprofiler/perftimelinemodel.cpp
index 762f689fc25..c49d432d751 100644
--- a/src/plugins/perfprofiler/perftimelinemodel.cpp
+++ b/src/plugins/perfprofiler/perftimelinemodel.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "perfdatareader.h"
+#include "perfprofilertr.h"
#include "perftimelinemodel.h"
#include "perftimelinemodelmanager.h"
#include "perftimelineresourcesrenderpass.h"
@@ -56,7 +57,7 @@ QVariantList PerfTimelineModel::labels() const
QVariantList result;
QVariantMap sample;
- sample.insert(QLatin1String("description"), tr("sample collected"));
+ sample.insert(QLatin1String("description"), Tr::tr("sample collected"));
sample.insert(QLatin1String("id"), PerfEvent::LastSpecialTypeId);
result << sample;
@@ -124,7 +125,7 @@ QString prettyPrintMemory(qint64 amount)
static const QByteArray &orUnknown(const QByteArray &string)
{
- static const QByteArray unknown = PerfTimelineModel::tr("[unknown]").toUtf8();
+ static const QByteArray unknown = Tr::tr("[unknown]").toUtf8();
return string.isEmpty() ? unknown : string;
}
@@ -139,12 +140,12 @@ QVariantMap PerfTimelineModel::details(int index) const
int typeId = selectionId(index);
if (isSample(index)) {
const PerfEventType::Attribute &attribute = manager->attribute(typeId);
- result.insert(tr("Details"), orUnknown(manager->string(attribute.name)));
- result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index),
- manager->traceDuration()));
+ result.insert(Tr::tr("Details"), orUnknown(manager->string(attribute.name)));
+ result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
+ manager->traceDuration()));
const int guessedFrames = -frame.numSamples;
if (guessedFrames > 0)
- result.insert(tr("Guessed"), tr("%n frames", nullptr, guessedFrames));
+ result.insert(Tr::tr("Guessed"), Tr::tr("%n frames", nullptr, guessedFrames));
for (int i = 0, end = numAttributes(index); i < end; ++i) {
const auto &name = orUnknown(manager->string(
manager->attribute(attributeId(index, i)).name));
@@ -153,8 +154,8 @@ QVariantMap PerfTimelineModel::details(int index) const
if (attribute.type == PerfEventType::TypeTracepoint) {
const PerfProfilerTraceManager::TracePoint &tracePoint
= manager->tracePoint(static_cast(attribute.config));
- result.insert(tr("System"), orUnknown(manager->string(tracePoint.system)));
- result.insert(tr("Name"), orUnknown(manager->string(tracePoint.name)));
+ result.insert(Tr::tr("System"), orUnknown(manager->string(tracePoint.system)));
+ result.insert(Tr::tr("Name"), orUnknown(manager->string(tracePoint.name)));
const QHash &extraData = m_extraData[index];
for (auto it = extraData.constBegin(), end = extraData.constEnd(); it != end; ++it) {
result.insert(QString::fromUtf8(manager->string(it.key())),
@@ -162,58 +163,58 @@ QVariantMap PerfTimelineModel::details(int index) const
}
}
if (!m_resourceBlocks.isEmpty()) {
- result.insert(tr("Resource Usage"), prettyPrintMemory(frame.resourcePeak));
- result.insert(tr("Resource Change"), prettyPrintMemory(frame.resourceDelta));
+ result.insert(Tr::tr("Resource Usage"), prettyPrintMemory(frame.resourcePeak));
+ result.insert(Tr::tr("Resource Change"), prettyPrintMemory(frame.resourceDelta));
}
} else if (typeId == PerfEvent::ThreadStartTypeId) {
- result.insert(tr("Details"), tr("thread started"));
- result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index),
- manager->traceDuration()));
+ result.insert(Tr::tr("Details"), Tr::tr("thread started"));
+ result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
+ manager->traceDuration()));
} else if (typeId == PerfEvent::ThreadEndTypeId) {
- result.insert(tr("Details"), tr("thread ended"));
- result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index),
- manager->traceDuration()));
+ result.insert(Tr::tr("Details"), Tr::tr("thread ended"));
+ result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
+ manager->traceDuration()));
} else if (typeId == PerfEvent::LostTypeId) {
- result.insert(tr("Details"), tr("lost sample"));
- result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index),
- manager->traceDuration()));
+ result.insert(Tr::tr("Details"), Tr::tr("lost sample"));
+ result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
+ manager->traceDuration()));
} else if (typeId == PerfEvent::ContextSwitchTypeId) {
- result.insert(tr("Details"), tr("context switch"));
- result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index),
- manager->traceDuration()));
+ result.insert(Tr::tr("Details"), Tr::tr("context switch"));
+ result.insert(Tr::tr("Timestamp"), Timeline::formatTime(startTime(index),
+ manager->traceDuration()));
} else {
const PerfProfilerTraceManager::Symbol &symbol
= manager->symbol(manager->aggregateAddresses()
? typeId : manager->symbolLocation(typeId));
- result.insert(tr("Duration"), Timeline::formatTime(duration(index)));
- result.insert(tr("Samples"), qAbs(frame.numSamples));
- result.insert(tr("Details"), orUnknown(manager->string(symbol.name)));
- result.insert(tr("Binary"), orUnknown(manager->string(symbol.binary)));
+ result.insert(Tr::tr("Duration"), Timeline::formatTime(duration(index)));
+ result.insert(Tr::tr("Samples"), qAbs(frame.numSamples));
+ result.insert(Tr::tr("Details"), orUnknown(manager->string(symbol.name)));
+ result.insert(Tr::tr("Binary"), orUnknown(manager->string(symbol.binary)));
const PerfEventType::Location &location = manager->location(typeId);
QString address = QString::fromLatin1("0x%1").arg(location.address, 1, 16);
if (frame.numSamples < 0)
- address += tr(" (guessed from context)");
- result.insert(tr("Address"), address);
+ address += Tr::tr(" (guessed from context)");
+ result.insert(Tr::tr("Address"), address);
const QByteArray &file = manager->string(location.file);
if (!file.isEmpty()) {
- result.insert(tr("Source"), QString::fromLatin1("%1:%2")
+ result.insert(Tr::tr("Source"), QString::fromLatin1("%1:%2")
.arg(QFileInfo(QLatin1String(file)).fileName()).arg(location.line));
} else {
- result.insert(tr("Source"), tr("[unknown]"));
+ result.insert(Tr::tr("Source"), Tr::tr("[unknown]"));
}
const LocationStats &stats = locationStats(typeId);
- result.insert(tr("Total Samples"), stats.numSamples);
- result.insert(tr("Total Unique Samples"), stats.numUniqueSamples);
+ result.insert(Tr::tr("Total Samples"), stats.numSamples);
+ result.insert(Tr::tr("Total Unique Samples"), stats.numUniqueSamples);
if (!m_resourceBlocks.isEmpty()) {
- result.insert(tr("Resource Peak"), prettyPrintMemory(frame.resourcePeak));
- result.insert(tr("Resource Change"), prettyPrintMemory(frame.resourceDelta));
+ result.insert(Tr::tr("Resource Peak"), prettyPrintMemory(frame.resourcePeak));
+ result.insert(Tr::tr("Resource Change"), prettyPrintMemory(frame.resourceDelta));
}
}
if (frame.resourceGuesses > 0)
- result.insert(tr("Resource Guesses"), prettyPrintMemory(frame.resourceGuesses));
+ result.insert(Tr::tr("Resource Guesses"), prettyPrintMemory(frame.resourceGuesses));
return result;
}
diff --git a/src/plugins/perfprofiler/perftracepointdialog.cpp b/src/plugins/perfprofiler/perftracepointdialog.cpp
index fc4b704e5fe..5711ac0a223 100644
--- a/src/plugins/perfprofiler/perftracepointdialog.cpp
+++ b/src/plugins/perfprofiler/perftracepointdialog.cpp
@@ -1,6 +1,7 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+#include "perfprofilertr.h"
#include "perftracepointdialog.h"
#include
@@ -35,7 +36,7 @@ namespace Internal {
PerfTracePointDialog::PerfTracePointDialog()
{
resize(400, 300);
- m_label = new QLabel(tr("Run the following script as root to create trace points?"));
+ m_label = new QLabel(Tr::tr("Run the following script as root to create trace points?"));
m_textEdit = new QTextEdit;
m_privilegesChooser = new QComboBox;
m_privilegesChooser->addItems({ELEVATE_METHOD_NA, ELEVATE_METHOD_PKEXEC, ELEVATE_METHOD_SUDO});
@@ -46,7 +47,7 @@ PerfTracePointDialog::PerfTracePointDialog()
m_label,
m_textEdit,
Form {
- tr("Elevate privileges using:"), m_privilegesChooser, br,
+ Tr::tr("Elevate privileges using:"), m_privilegesChooser, br,
},
m_buttonBox,
}.attachTo(this);
@@ -57,7 +58,7 @@ PerfTracePointDialog::PerfTracePointDialog()
m_device = DeviceKitAspect::device(kit);
if (!m_device) {
- m_textEdit->setPlainText(tr("Error: No device available for active target."));
+ m_textEdit->setPlainText(Tr::tr("Error: No device available for active target."));
return;
}
}
@@ -72,8 +73,8 @@ PerfTracePointDialog::PerfTracePointDialog()
if (file.open(QIODevice::ReadOnly)) {
m_textEdit->setPlainText(QString::fromUtf8(file.readAll()));
} else {
- m_textEdit->setPlainText(tr("Error: Failed to load trace point script %1: %2.")
- .arg(file.fileName()).arg(file.errorString()));
+ m_textEdit->setPlainText(Tr::tr("Error: Failed to load trace point script %1: %2.")
+ .arg(file.fileName()).arg(file.errorString()));
}
m_privilegesChooser->setCurrentText(
@@ -88,7 +89,7 @@ PerfTracePointDialog::~PerfTracePointDialog() = default;
void PerfTracePointDialog::runScript()
{
- m_label->setText(tr("Executing script..."));
+ m_label->setText(Tr::tr("Executing script..."));
m_textEdit->setReadOnly(true);
m_privilegesChooser->setEnabled(false);
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
@@ -112,11 +113,11 @@ void PerfTracePointDialog::handleProcessDone()
const QProcess::ProcessError error = m_process->error();
QString message;
if (error == QProcess::FailedToStart) {
- message = tr("Failed to run trace point script: %1").arg(error);
+ message = Tr::tr("Failed to run trace point script: %1").arg(error);
} else if ((m_process->exitStatus() == QProcess::CrashExit) || (m_process->exitCode() != 0)) {
- message = tr("Failed to create trace points.");
+ message = Tr::tr("Failed to create trace points.");
} else {
- message = tr("Created trace points for: %1").arg(QString::fromUtf8(
+ message = Tr::tr("Created trace points for: %1").arg(QString::fromUtf8(
m_process->readAllStandardOutput().trimmed().replace('\n', ", ")));
}
m_label->setText(message);