| 124 | } |
| 125 | |
| 126 | bool 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 | |
| 165 | QVariant Breakpoint::data(int column, int role) const |
| 166 | { |
no test coverage detected