CtfVisualizer: Do some cleanup

Remove unused headers.
Use using namespace and drop unneeded namespace scopes.
Replace QVector with QList.
Return default constructed objects in default return statements.
Avoid empty arg brackets in some lambdas.
Use default member initializers.

Change-Id: I11e62a291be3fa5bde4156e7a316765ee697b852
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Jarek Kobus
2023-09-27 19:36:19 +02:00
parent 5c52bdd0e9
commit bc5a2dbf14
15 changed files with 71 additions and 125 deletions

View File

@@ -8,16 +8,12 @@
#include "ctfvisualizertr.h"
#include <tracing/timelineformattime.h>
#include <tracing/timelinemodelaggregator.h>
#include <utils/qtcassert.h>
#include <QDebug>
#include <utils/qtcassert.h>
#include <string>
namespace CtfVisualizer {
namespace Internal {
namespace CtfVisualizer::Internal {
using json = nlohmann::json;
using namespace Constants;
@@ -46,7 +42,7 @@ QVariantList CtfTimelineModel::labels() const
{
QVariantList result;
QVector<std::string> sortedCounterNames = m_counterNames;
QList<std::string> sortedCounterNames = m_counterNames;
std::sort(sortedCounterNames.begin(), sortedCounterNames.end());
for (int i = 0; i < sortedCounterNames.size(); ++i) {
QVariantMap element;
@@ -190,7 +186,7 @@ void CtfTimelineModel::finalize(double traceBegin, double traceEnd, const QStrin
m_rows = computeRows(&m_maxStackSize);
++m_maxStackSize; // index -> count
QVector<std::string> sortedCounterNames = m_counterNames;
QList<std::string> sortedCounterNames = m_counterNames;
std::sort(sortedCounterNames.begin(), sortedCounterNames.end());
m_counterIndexToRow.resize(m_counterNames.size());
for (int i = 0; i < m_counterIndexToRow.size(); ++i) {
@@ -376,7 +372,5 @@ const QString &CtfTimelineModel::reuse(const QString &value)
return *it;
}
} // namespace Internal
} // namespace CtfVisualizer
} // namespace CtfVisualizer::Internal