MCPcopy Create free account
hub / github.com/KDE/kdevelop / setData

Method setData

kdevplatform/debugger/breakpoint/breakpoint.cpp:126–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126bool Breakpoint::setData(int index, const QVariant& value)
127{
128 if (index == EnableColumn)
129 {
130 m_enabled = static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked;
131
132 // enabled affects the breakpoint mark type.
133 updateMarkType();
134 }
135
136 if (index == LocationColumn) {
137 QString s = value.toString();
138 QRegExp rx(QStringLiteral("^(.+):([0-9]+)$"));
139 int idx = rx.indexIn(s);
140 if (m_kind == CodeBreakpoint && idx != -1) {
141 const auto url = QUrl::fromLocalFile(rx.cap(1));
142 const auto line = rx.cap(2).toInt() - 1;
143
144 if (isSupportedBreakpointUrl(url)) {
145 m_expression.clear();
146 setLocation(url, line);
147 return true; // reportChange() is already called by setLocation()
148 }
149 }
150 m_expression = s;
151 stopDocumentLineTracking();
152 m_url.clear();
153 m_line = -1;
154 }
155
156 if (index == ConditionColumn) {
157 m_condition = value.toString();
158 }
159
160 reportChange(static_cast<Column>(index));
161
162 return true;
163}
164
165QVariant Breakpoint::data(int column, int role) const
166{

Callers 3

slotDataInsertedMethod · 0.45

Calls 4

isSupportedBreakpointUrlFunction · 0.85
toIntMethod · 0.80
toStringMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected