Skip to content

Commit

Permalink
- Fixed for new getClassNames.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10710 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Dec 14, 2011
1 parent 9e90ac2 commit f28d566
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/LibraryWidget.cpp
Expand Up @@ -1253,7 +1253,7 @@ SearchMSLWidget::SearchMSLWidget(MainWindow *pParent)
{
mpParentMainWindow = pParent;
// get MSL recursive
mMSLItemsList = mpParentMainWindow->mpOMCProxy->getClassNamesRecursive(tr("Modelica"));
mMSLItemsList = mpParentMainWindow->mpOMCProxy->getClassNames(tr(""), tr("true"));
// create search controls
mpSearchTextBox = new MSLSearchBox(this);
connect(mpSearchTextBox, SIGNAL(returnPressed()), SLOT(searchMSL()));
Expand Down
19 changes: 7 additions & 12 deletions OMEdit/OMEditGUI/OMCProxy.cpp
Expand Up @@ -737,10 +737,15 @@ void OMCProxy::loadStandardLibrary()

//! Gets the list of classes from OMC.
//! @param className is the name of the class whose sub classes are retrieved.
//! @param recursive recursively retrieve all the sub classes.
//! @param qualified returns the class names as qualified path.
//! @return QStringList the list of classes
QStringList OMCProxy::getClassNames(QString className)
QStringList OMCProxy::getClassNames(QString className, QString recursive, QString qualified)
{
sendCommand("getClassNames(" + className + ")");
if (className.isEmpty())
sendCommand("getClassNames(recursive=" + recursive + ", qualified=" + qualified + ")");
else
sendCommand("getClassNames(" + className + ", recursive=" + recursive + ", qualified=" + qualified + ")");
QString result = StringHandler::removeFirstLastCurlBrackets(getResult());
QStringList list = result.split(",", QString::SkipEmptyParts);
return list;
Expand All @@ -757,16 +762,6 @@ QStringList OMCProxy::getClassInformation(QString modelName)
return list;
}

//! Gets the list of classes from OMC recursively.
//! @param className is the name of the class whose sub classes are retrieved.
//! @return QStringList the list of classes
QStringList OMCProxy::getClassNamesRecursive(QString className)
{
sendCommand("getClassNamesRecursive(" + className + ")");
QStringList list = getResult().split(" ", QString::SkipEmptyParts);
return list;
}

//! Gets the list of packages from OMC.
//! @param packageName is the name of the package whose sub packages are retrieved.
//! @return QStringList the list of packages
Expand Down
3 changes: 1 addition & 2 deletions OMEdit/OMEditGUI/OMCProxy.h
Expand Up @@ -111,8 +111,7 @@ class OMCProxy : public QObject
bool setEnvironmentVar(QString name, QString value);
QString getEnvironmentVar(QString name);
void loadStandardLibrary();
QStringList getClassNames(QString className = QString());
QStringList getClassNamesRecursive(QString className);
QStringList getClassNames(QString className = QString(), QString recursive = QString("false"), QString qualified = QString("false"));
QStringList getClassInformation(QString modelName);
QStringList getPackages(QString packageName);
bool isPackage(QString className);
Expand Down

0 comments on commit f28d566

Please sign in to comment.