Skip to content

Commit

Permalink
- Fixed the back slashes issue.
Browse files Browse the repository at this point in the history
- Speed up the diagram load time.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9616 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Aug 9, 2011
1 parent 0d9cdd4 commit 3098119
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions OMEdit/OMEditGUI/Component.cpp
Expand Up @@ -1110,6 +1110,14 @@ void Component::getClassComponents(QString className, int type, Component *pPare
QString inheritedClass = mpOMCProxy->getNthInheritedClass(className, i);
QString annotationString;

// If the inherited class is one of the builtin type such as Real we can
// stop here, because the class can not contain any components, etc.
if(this->mpOMCProxy->isBuiltinType(inheritedClass))
{
mpInheritanceList.append(new Component("", inheritedClass, mpOMCProxy->isWhat(StringHandler::CONNECTOR, inheritedClass), this));
return;
}

if (type == StringHandler::ICON)
annotationString = mpOMCProxy->getIconAnnotation(inheritedClass);
else if (type == StringHandler::DIAGRAM)
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/OMCProxy.cpp
Expand Up @@ -1148,7 +1148,7 @@ bool OMCProxy::saveModifiedModel(QString modelText)
QString OMCProxy::list(QString className)
{
sendCommand("list(" + className + ")");
return StringHandler::removeFirstLastQuotes(getResult()).trimmed();
return StringHandler::removeFirstLastQuotes(getResult()).trimmed().replace("\\\"", "\"");
}

bool OMCProxy::addClassAnnotation(QString className, QString annotation)
Expand Down
6 changes: 4 additions & 2 deletions OMEdit/OMEditGUI/ProjectTabWidget.cpp
Expand Up @@ -109,7 +109,6 @@ void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
//! @todo Grid Lines changes when resize the window. Update it.
if (mpParentProjectTab->mpParentProjectTabWidget->mShowLines)
{
//painter->scale(1.0, -1.0);
painter->setBrush(Qt::NoBrush);
painter->setPen(Qt::gray);

Expand Down Expand Up @@ -2429,6 +2428,7 @@ QToolButton* ProjectTab::getModelicaTextToolButton()
//! @see updateModel(QString name)
bool ProjectTab::modelicaEditorTextChanged()
{
this->mOpenMode = true;
MainWindow *pMainWindow = mpParentProjectTabWidget->mpParentMainWindow;
QStringList models = mpModelicaEditor->getModelsNames();
// if there was some error in modelicatext then
Expand Down Expand Up @@ -2462,6 +2462,7 @@ bool ProjectTab::modelicaEditorTextChanged()
getModelIconDiagram();
// change the model type label in the status bar of projecttab
mpModelicaTypeLabel->setText(StringHandler::getModelicaClassType(mpParentProjectTabWidget->mpParentMainWindow->mpOMCProxy->getClassRestriction(mModelNameStructure)));
this->mOpenMode = false;

/*
if (!modelName.isEmpty())
Expand Down Expand Up @@ -2688,6 +2689,7 @@ ProjectTab* ProjectTabWidget::getRemovedTabByName(QString name)
int ProjectTabWidget::addTab(ProjectTab *tab, QString tabName)
{
int position;
tabName = StringHandler::getLastWordAfterDot(tabName);
// if tab is not saved then add the star with the name
position = QTabWidget::addTab(tab, QString(tabName).append(tab->mIsSaved ? "" : "*"));
// if (!tab->mIsSaved)
Expand Down Expand Up @@ -2807,7 +2809,7 @@ void ProjectTabWidget::addDiagramViewTab(QTreeWidgetItem *item, int column)
mpParentMainWindow->mpOMCProxy->getClassRestriction(treeNode->mNameStructure), StringHandler::DIAGRAM,
true, false, false, this);
newTab->mIsSaved = true;
newTab->mTabPosition = addTab(newTab, StringHandler::getLastWordAfterDot(treeNode->mNameStructure));
newTab->mTabPosition = addTab(newTab, treeNode->mName);

Component *diagram;
QString result = mpParentMainWindow->mpOMCProxy->getDiagramAnnotation(treeNode->mNameStructure);
Expand Down

0 comments on commit 3098119

Please sign in to comment.