From 44b7584684c85e3aa688b50efa57ca74210dbc0a Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Mon, 29 May 2023 11:09:31 +0200 Subject: [PATCH] Do not mark the classes visible if any of children is public (#10757) Give preference to protected over public --- OMEdit/OMEditLIB/Editors/ModelicaEditor.cpp | 4 ++++ OMEdit/OMEditLIB/Modeling/LibraryTreeWidget.cpp | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/OMEdit/OMEditLIB/Editors/ModelicaEditor.cpp b/OMEdit/OMEditLIB/Editors/ModelicaEditor.cpp index db9f35e9873..52e38b7c4e9 100644 --- a/OMEdit/OMEditLIB/Editors/ModelicaEditor.cpp +++ b/OMEdit/OMEditLIB/Editors/ModelicaEditor.cpp @@ -438,6 +438,10 @@ bool ModelicaEditor::validateText(LibraryTreeItem **pLibraryTreeItem) mLastValidText = mpPlainTextEdit->toPlainText(); } } + /* Update the Libraries Browser when Modelica text change is done + * See discussion #10728 + */ + MainWindow::instance()->getLibraryWidget()->getLibraryTreeModel()->showHideProtectedClasses(); return true; } diff --git a/OMEdit/OMEditLIB/Modeling/LibraryTreeWidget.cpp b/OMEdit/OMEditLIB/Modeling/LibraryTreeWidget.cpp index bae08d3d986..8abba8d8dc4 100644 --- a/OMEdit/OMEditLIB/Modeling/LibraryTreeWidget.cpp +++ b/OMEdit/OMEditLIB/Modeling/LibraryTreeWidget.cpp @@ -1116,13 +1116,6 @@ bool LibraryTreeProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &s if (pLibraryTreeItem && pLibraryTreeItem->getNameStructure().compare("OMEdit.Search.Feature") == 0) { return false; } - // if any of children matches the filter, then current index matches the filter as well - int rows = sourceModel()->rowCount(index); - for (int i = 0 ; i < rows ; ++i) { - if (filterAcceptsRow(i, index)) { - return true; - } - } // check current index itself if (pLibraryTreeItem) { if ((pLibraryTreeItem->getAccess() == LibraryTreeItem::hide