@@ -179,7 +179,7 @@ boost::optional<ConnectionId> NetworkEditor::requestConnection(const PortDescrip
179179namespace
180180{
181181 const int TagTextKey = 123 ;
182-
182+
183183 ModuleProxyWidget* findById (const QList<QGraphicsItem*>& list, const std::string& id)
184184 {
185185 Q_FOREACH (QGraphicsItem* item, list)
@@ -782,11 +782,6 @@ class NetworkSearchEngine
782782 {
783783 subresults = searchItem (w, text);
784784 }
785- // else if (auto c = dynamic_cast<ConnectionLine*>(item))
786- // {
787- // //qDebug() << "connection line. should search note--or maybe not.";
788- // //qDebug() << item;
789- // }
790785 else if (auto t = dynamic_cast <QGraphicsTextItem*>(item))
791786 {
792787 subresults = searchItem (t, text);
@@ -798,7 +793,6 @@ class NetworkSearchEngine
798793 else
799794 {
800795 // qDebug() << "something else";
801- // qDebug() << item;
802796 }
803797 results.insert (results.end (), subresults.begin (), subresults.end ());
804798 }
@@ -817,7 +811,14 @@ class NetworkSearchEngine
817811 tagColor_ (mod->data (TagDataKey).toInt ()));
818812 }
819813
820- // TODO: state keys and values
814+ auto metadata = mod->getModuleWidget ()->metadataToString ();
815+ if (metadata.contains (text, Qt::CaseInsensitive))
816+ {
817+ results.emplace_back (" Module metadata match in" ,
818+ QString::fromStdString (id),
819+ [mod]() { mod->showAndColor (Qt::yellow); },
820+ Qt::yellow);
821+ }
821822
822823 return results;
823824 }
0 commit comments