Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added the camel case for components name.
  • Loading branch information
adeas31 committed Jun 9, 2015
1 parent dfaf7cd commit 697cc62
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -418,7 +418,7 @@ bool GraphicsView::addComponent(QString className, QPointF position)
// get the model defaultComponentName
QString defaultName = pMainWindow->getOMCProxy()->getDefaultComponentName(className);
if (defaultName.isEmpty()) {
name = getUniqueComponentName(name.toLower());
name = getUniqueComponentName(StringHandler::toCamelCase(name));
} else {
if (checkComponentName(defaultName)) {
name = defaultName;
Expand Down
13 changes: 13 additions & 0 deletions OMEdit/OMEditGUI/Util/StringHandler.cpp
Expand Up @@ -1482,3 +1482,16 @@ QString StringHandler::makeClassNameRelative(QString draggedClassName, QString d
return draggedClassName;
}
}

/*!
* \brief StringHandler::toCamelCase
* Converts the string to camel case.
* \param str
* \return the string converted to camel case.
*/
QString StringHandler::toCamelCase(QString str)
{
QString s = str;
s[0] = s[0].toLower();
return s;
}
1 change: 1 addition & 0 deletions OMEdit/OMEditGUI/Util/StringHandler.h
Expand Up @@ -148,6 +148,7 @@ class StringHandler : public QObject
static QString getSimulationMessageTypeString(StringHandler::SimulationMessageType type);
static QColor getSimulationMessageTypeColor(StringHandler::SimulationMessageType type);
static QString makeClassNameRelative(QString draggedClassName, QString droppedClassName);
static QString toCamelCase(QString str);
protected:
static QString mLastOpenDir;
};
Expand Down

0 comments on commit 697cc62

Please sign in to comment.