Skip to content

Commit

Permalink
- Fixed loading of bitmap shapes within a component.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19583 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Mar 14, 2014
1 parent 09b22f2 commit ad0ba89
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion OMEdit/OMEditGUI/Annotations/ShapeAnnotation.cpp
Expand Up @@ -1007,7 +1007,20 @@ void ShapeAnnotation::setFileName(QString fileName, Component *pComponent)
mOriginalFileName = fileName;
QUrl fileUrl(mOriginalFileName);
QFileInfo fileInfo(mOriginalFileName);
QFileInfo classFileInfo(pGraphicsView->getModelWidget()->getLibraryTreeNode()->getFileName());
QString classFileName = "";
/* if the bitmap is part of a component then read the component filename. */
if (pComponent)
{
QStringList classInformation = pOMCProxy->getClassInformation(pComponent->getClassName());
if (classInformation.size() > 2)
classFileName = classInformation.at(2);
}
/* if bitmap is part of a icon/diagram of a class then read the class filename. */
else
{
classFileName = pGraphicsView->getModelWidget()->getLibraryTreeNode()->getFileName();
}
QFileInfo classFileInfo(classFileName);
/* if its a modelica:// link then make it absolute path */
if (fileUrl.scheme().toLower().compare("modelica") == 0)
{
Expand Down

0 comments on commit ad0ba89

Please sign in to comment.