Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Fixed duplication of Packages.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25388 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Apr 4, 2015
1 parent c3a75a1 commit cbc5bf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -628,14 +628,15 @@ void LibraryTreeWidget::addModelicaLibraries(QSplashScreen *pSplashScreen)
void LibraryTreeWidget::createLibraryTreeNodes(LibraryTreeNode *pLibraryTreeNode)
{
QStringList libs = mpMainWindow->getOMCProxy()->getClassNames(pLibraryTreeNode->getNameStructure(), true);
if (!libs.isEmpty())
if (!libs.isEmpty()) {
libs.removeFirst();
}
QList<LibraryTreeNode*> nodes;
foreach (QString lib, libs)
{
foreach (QString lib, libs) {
/* $Code is a special OpenModelica keyword. No API command will work if we use it. */
if (lib.contains("$Code"))
if (lib.contains("$Code")) {
continue;
}
QString name = StringHandler::getLastWordAfterDot(lib);
QString parentName = StringHandler::removeLastWordAfterDot(lib);
OMCInterface::getClassInformation_res classInformation = mpMainWindow->getOMCProxy()->getClassInformation(lib);
Expand All @@ -661,8 +662,7 @@ void LibraryTreeWidget::expandLibraryTreeNode(LibraryTreeNode *pLibraryTreeNode)
int progressValue = 0;
mpMainWindow->getProgressBar()->setRange(0, pLibraryTreeNode->childCount());
mpMainWindow->showProgressBar();
for (int i = 0 ; i < pLibraryTreeNode->childCount() ; i++)
{
for (int i = 0 ; i < pLibraryTreeNode->childCount() ; i++) {
loadLibraryTreeNode(pLibraryTreeNode, dynamic_cast<LibraryTreeNode*>(pLibraryTreeNode->child(i)));
mpMainWindow->getProgressBar()->setValue(++progressValue);
}
Expand Down Expand Up @@ -1490,8 +1490,7 @@ void LibraryTreeWidget::expandLibraryTreeNode(QTreeWidgetItem *item)
blockSignals(true);
collapseItem(item);
blockSignals(false);
if (!isLibraryTreeNodeExpanded(item))
{
if (!isLibraryTreeNodeExpanded(item)) {
LibraryTreeNode *pLibraryTreeNode = dynamic_cast<LibraryTreeNode*>(item);
addToExpandedLibraryTreeNodesList(pLibraryTreeNode);
QApplication::setOverrideCursor(Qt::WaitCursor);
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Modeling/ModelicaClassDialog.cpp
Expand Up @@ -851,7 +851,7 @@ void DuplicateClassDialog::duplicateClass()
QString className = mpNameTextBox->text().trimmed();
pLibraryTreeNode = pLibraryTreeWidget->addLibraryTreeNode(className, mpPathTextBox->text().trimmed(), false);
pLibraryTreeNode->setSaveContentsType(mpLibraryTreeNode->getSaveContentsType());
pLibraryTreeWidget->addToExpandedLibraryTreeNodesList(pLibraryTreeNode);
pLibraryTreeWidget->createLibraryTreeNodes(pLibraryTreeNode);
}
accept();
}
Expand Down

0 comments on commit cbc5bf1

Please sign in to comment.