Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/jammy_warnings' into jammy_warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcarroll committed Aug 28, 2023
2 parents fc7cebb + 01129cc commit 69f4cdf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/plugins/topic_viewer/TopicViewer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,19 @@ void TopicViewer::UpdateModel()
std::vector<transport::MessagePublisher> publishers;
std::vector<transport::MessagePublisher> subscribers;
this->dataPtr->node.TopicInfo(topics[i], publishers, subscribers);

if (publishers.empty())
continue;

// ToDo: Go over all the publishers and also consider subscribers.
// Review the way we're using "topicsToRemove" as the logic doesn't look
// very clear to me.

std::string msgType = publishers[0].MsgTypeName();

// skip the matched topics
if (this->dataPtr->currentTopics.count(topics[i]) &&
this->dataPtr->currentTopics[topics[i]] == msgType)
this->dataPtr->currentTopics[topics[i]] == msgType)
{
topicsToRemove.erase(topics[i]);
continue;
Expand All @@ -413,7 +421,7 @@ void TopicViewer::UpdateModel()
auto child = root->child(i);

if (child->data(NAME_ROLE).toString().toStdString() == topic.first &&
child->data(TYPE_ROLE).toString().toStdString() == topic.second)
child->data(TYPE_ROLE).toString().toStdString() == topic.second)
{
// remove from model
root->removeRow(i);
Expand Down

0 comments on commit 69f4cdf

Please sign in to comment.