- QString const & name = toqstr(lay.name() + (lay.isUnknown() ? " (unknown)" : ""));
- if (name == currentText())
+ QString const newLayout = toqstr(lay.name());
+
+ int const curItem = currentIndex();
+ QModelIndex const mindex =
+ filterModel_->mapToSource(filterModel_->index(curItem, 1));
+ QString const & currentLayout = model_->itemFromIndex(mindex)->text();
+ if (newLayout == currentLayout) {
+ LYXERR(Debug::GUI, "Already had " << newLayout << " selected.");