Skip to content

Commit 2955100

Browse files
committed
silence clang-tidy warning and simplify enum
The warning is plain wrong, the function isn't detected by qt if it is in an anonymous namespace and it is used. Enum automatically counts up so there is no need to manually set these values.
1 parent c413648 commit 2955100

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/models/eventmodel.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
#include <QSet>
1414

15-
static bool operator<(const EventModel::Process& process, qint32 pid)
15+
// silence clang warnings
16+
// NOLINTNEXTLINE(misc-use-anonymous-namespace)
17+
[[maybe_unused]] static bool operator<(const EventModel::Process& process, qint32 pid)
1618
{
1719
return process.pid < pid;
1820
}
@@ -21,12 +23,12 @@ namespace {
2123
enum class Tag : quint8
2224
{
2325
Invalid = 0,
24-
Root = 1,
25-
Overview = 2,
26-
Cpus = 3,
27-
Processes = 4,
28-
Threads = 5,
29-
Tracepoints = 6,
26+
Root,
27+
Overview,
28+
Cpus,
29+
Processes,
30+
Threads,
31+
Tracepoints,
3032
};
3133

3234
enum OverViewRow : quint8

0 commit comments

Comments
 (0)