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

Method data

kdevplatform/debugger/breakpoint/breakpoint.cpp:165–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165QVariant Breakpoint::data(int column, int role) const
166{
167 if (column == EnableColumn)
168 {
169 if (role == Qt::CheckStateRole)
170 return m_enabled ? Qt::Checked : Qt::Unchecked;
171 else if (role == Qt::DisplayRole)
172 return QVariant();
173 else
174 return QVariant();
175 }
176
177 if (column == StateColumn)
178 {
179 if (role == Qt::DecorationRole) {
180 if (!errorText().isEmpty()) {
181 return QIcon::fromTheme(QStringLiteral("dialog-warning"));
182 }
183 switch (state()) {
184 case NotStartedState:
185 return QVariant();
186 case DirtyState:
187 return QIcon::fromTheme(QStringLiteral("system-switch-user"));
188 case PendingState:
189 return QIcon::fromTheme(QStringLiteral("help-contents"));
190 case CleanState:
191 return QIcon::fromTheme(QStringLiteral("dialog-ok-apply"));
192 }
193 } else if (role == Qt::ToolTipRole) {
194 if (!errorText().isEmpty()) {
195 return i18nc("@info:tooltip", "Error");
196 }
197 switch (state()) {
198 case NotStartedState:
199 return QString();
200 case DirtyState:
201 return i18nc("@info:tooltip", "Dirty");
202 case PendingState:
203 return i18nc("@info:tooltip", "Pending");
204 case CleanState:
205 return i18nc("@info:tooltip", "Clean");
206 }
207 } else if (role == Qt::DisplayRole) {
208 return QVariant();
209 }
210 return QVariant();
211 }
212
213 if (column == TypeColumn && role == Qt::DisplayRole)
214 {
215 return BREAKPOINT_KINDS[m_kind];
216 }
217
218 if (column == ConditionColumn && (role == Qt::DisplayRole || role == Qt::EditRole)) {
219 return m_condition;
220 }
221
222 if (column == LocationColumn) {

Callers

nothing calls this directly

Calls 4

QVariantClass · 0.70
QStringClass · 0.50
isEmptyMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected