| 144 | } |
| 145 | |
| 146 | void DecoderStack::build_row() |
| 147 | { |
| 148 | //release source |
| 149 | for (auto &kv : _rows) |
| 150 | { |
| 151 | kv.second->clear(); //destory all annotations |
| 152 | delete kv.second; |
| 153 | } |
| 154 | _rows.clear(); |
| 155 | |
| 156 | // Add classes |
| 157 | for (auto dec : _stack) |
| 158 | { |
| 159 | const srd_decoder *const decc = dec->decoder(); |
| 160 | assert(dec->decoder()); |
| 161 | |
| 162 | dec->reset_start(); |
| 163 | |
| 164 | // Add a row for the decoder if it doesn't have a row list |
| 165 | if (!decc->annotation_rows) { |
| 166 | const Row row(decc); |
| 167 | _rows[row] = new decode::RowData(); |
| 168 | std::map<const decode::Row, bool>::const_iterator iter = _rows_gshow.find(row); |
| 169 | if (iter == _rows_gshow.end()) { |
| 170 | _rows_gshow[row] = true; |
| 171 | if (row.title().contains("bit", Qt::CaseInsensitive) || |
| 172 | row.title().contains("warning", Qt::CaseInsensitive)) { |
| 173 | _rows_lshow[row] = false; |
| 174 | } else { |
| 175 | _rows_lshow[row] = true; |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | // Add the decoder rows |
| 181 | int order = 0; |
| 182 | for (const GSList *l = decc->annotation_rows; l; l = l->next) |
| 183 | { |
| 184 | const srd_decoder_annotation_row *const ann_row = |
| 185 | (srd_decoder_annotation_row *)l->data; |
| 186 | assert(ann_row); |
| 187 | |
| 188 | const Row row(decc, ann_row, order); |
| 189 | |
| 190 | // Add a new empty row data object |
| 191 | _rows[row] = new decode::RowData(); |
| 192 | std::map<const decode::Row, bool>::const_iterator iter = _rows_gshow.find(row); |
| 193 | if (iter == _rows_gshow.end()) { |
| 194 | _rows_gshow[row] = true; |
| 195 | if (row.title().contains("bit", Qt::CaseInsensitive) || |
| 196 | row.title().contains("warning", Qt::CaseInsensitive)) { |
| 197 | _rows_lshow[row] = false; |
| 198 | } else { |
| 199 | _rows_lshow[row] = true; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | // Map out all the classes |