Skip to content

Commit 58b912c

Browse files
committed
gui: in select, skip string compare for non-simple name filters
Signed-off-by: Matt Liberty <[email protected]>
1 parent 7a99778 commit 58b912c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/gui/src/gui.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,16 +497,21 @@ int Gui::select(const std::string& type,
497497
descriptor->visitAllObjects([&](const Selected& sel) {
498498
if (!name_filter.empty()) {
499499
const std::string sel_name = sel.getName();
500-
if (sel_name != name_filter
501-
&& (is_simple ||
500+
if (is_simple) {
501+
if (sel_name != name_filter) {
502+
return;
503+
}
504+
} else {
505+
if (
502506
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
503-
!reg_filter.match(QString::fromStdString(sel_name)).hasMatch()
507+
!reg_filter.match(QString::fromStdString(sel_name)).hasMatch()
504508

505509
#else
506-
!reg_filter.exactMatch(QString::fromStdString(sel_name))
510+
!reg_filter.exactMatch(QString::fromStdString(sel_name))
507511
#endif
508-
)) {
509-
return; // name doesn't match the filter
512+
) {
513+
return;
514+
}
510515
}
511516
}
512517

0 commit comments

Comments
 (0)