Skip to content

Commit

Permalink
Fixes #3585. Fixed creating class within a package.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Jan 25, 2016
1 parent 6feda15 commit 86010c6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -1383,14 +1383,13 @@ void LibraryTreeModel::updateLibraryTreeItemClassText(LibraryTreeItem *pLibraryT
void LibraryTreeModel::readLibraryTreeItemClassText(LibraryTreeItem *pLibraryTreeItem)
{
if (!pLibraryTreeItem->isFilePathValid()) {
// If class is top level then
if (pLibraryTreeItem->isTopLevel()) {
// If class is nested in a class and nested class is saved in the same file as parent.
if (pLibraryTreeItem->isInPackageOneFile()) {
updateLibraryTreeItemClassText(pLibraryTreeItem);
} else {
if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::Modelica) {
pLibraryTreeItem->setClassText(mpLibraryWidget->getMainWindow()->getOMCProxy()->listFile(pLibraryTreeItem->getNameStructure()));
}
} else {
// If class is nested in a class
updateLibraryTreeItemClassText(pLibraryTreeItem);
}
} else {
// If class is top level then simply read its file contents.
Expand Down

0 comments on commit 86010c6

Please sign in to comment.