kdevplatform/debugger: use QString for prepared breakpoint kinds strings

Avoids repeated conversion
parent dd4f0394
...@@ -28,19 +28,21 @@ ...@@ -28,19 +28,21 @@
#include "breakpointmodel.h" #include "breakpointmodel.h"
#include <array>
using namespace KDevelop; using namespace KDevelop;
static const char* const BREAKPOINT_KINDS[Breakpoint::LastBreakpointKind] = { static const std::array<QString, Breakpoint::LastBreakpointKind> BREAKPOINT_KINDS = {
"Code", QStringLiteral("Code"),
"Write", QStringLiteral("Write"),
"Read", QStringLiteral("Read"),
"Access" QStringLiteral("Access"),
}; };
static Breakpoint::BreakpointKind stringToKind(const QString& kindString) static Breakpoint::BreakpointKind stringToKind(const QString& kindString)
{ {
for (int i = 0; i < Breakpoint::LastBreakpointKind; ++i) { for (int i = 0; i < Breakpoint::LastBreakpointKind; ++i) {
if (kindString == QLatin1String(BREAKPOINT_KINDS[i])) { if (kindString == BREAKPOINT_KINDS[i]) {
return (Breakpoint::BreakpointKind)i; return (Breakpoint::BreakpointKind)i;
} }
} }
...@@ -171,7 +173,7 @@ QVariant Breakpoint::data(int column, int role) const ...@@ -171,7 +173,7 @@ QVariant Breakpoint::data(int column, int role) const
if (column == TypeColumn && role == Qt::DisplayRole) if (column == TypeColumn && role == Qt::DisplayRole)
{ {
return QLatin1String(BREAKPOINT_KINDS[m_kind]); return BREAKPOINT_KINDS[m_kind];
} }
if (column == ConditionColumn && (role == Qt::DisplayRole || role == Qt::EditRole)) { if (column == ConditionColumn && (role == Qt::DisplayRole || role == Qt::EditRole)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment