diff --git a/DSView/pv/data/decode/row.cpp b/DSView/pv/data/decode/row.cpp index fd798eb7..99958900 100755 --- a/DSView/pv/data/decode/row.cpp +++ b/DSView/pv/data/decode/row.cpp @@ -28,13 +28,15 @@ namespace decode { Row::Row() : _decoder(NULL), - _row(NULL) + _row(NULL), + _order(-1) { } -Row::Row(const srd_decoder *decoder, const srd_decoder_annotation_row *row) : +Row::Row(const srd_decoder *decoder, const srd_decoder_annotation_row *row, const int order) : _decoder(decoder), - _row(row) + _row(row), + _order(order) { } @@ -69,7 +71,7 @@ const QString Row::title() const bool Row::operator<(const Row &other) const { return (_decoder < other._decoder) || - (_decoder == other._decoder && _row < other._row); + (_decoder == other._decoder && _order < other._order); } } // decode diff --git a/DSView/pv/data/decode/row.h b/DSView/pv/data/decode/row.h index 73324302..9466a68d 100755 --- a/DSView/pv/data/decode/row.h +++ b/DSView/pv/data/decode/row.h @@ -39,7 +39,8 @@ public: ~Row(); Row(const srd_decoder *decoder, - const srd_decoder_annotation_row *row = NULL); + const srd_decoder_annotation_row *row = NULL, + const int order = -1); const srd_decoder* decoder() const; const srd_decoder_annotation_row* row() const; @@ -51,6 +52,7 @@ public: private: const srd_decoder *_decoder; const srd_decoder_annotation_row *_row; + int _order; }; } // decode diff --git a/DSView/pv/data/decoderstack.cpp b/DSView/pv/data/decoderstack.cpp index 61a66dac..60bb699e 100755 --- a/DSView/pv/data/decoderstack.cpp +++ b/DSView/pv/data/decoderstack.cpp @@ -147,13 +147,14 @@ void DecoderStack::build_row() } // Add the decoder rows + int order = 0; for (const GSList *l = decc->annotation_rows; l; l = l->next) { const srd_decoder_annotation_row *const ann_row = (srd_decoder_annotation_row *)l->data; assert(ann_row); - const Row row(decc, ann_row); + const Row row(decc, ann_row, order); // Add a new empty row data object _rows[row] = decode::RowData(); @@ -173,6 +174,8 @@ void DecoderStack::build_row() ll; ll = ll->next) _class_rows[make_pair(decc, GPOINTER_TO_INT(ll->data))] = row; + + order++; } } }