Skip to content

Commit

Permalink
- Trim the whitespace.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20157 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Apr 16, 2014
1 parent d227c75 commit 4103dcb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions OMEdit/OMEditGUI/GUI/Dialogs/ModelicaClassDialog.cpp
Expand Up @@ -380,13 +380,13 @@ void ModelicaClassDialog::createModelicaClass()
QString model, parentPackage;
if (mpParentClassTextBox->text().isEmpty())
{
model = mpNameTextBox->text();
model = mpNameTextBox->text().trimmed();
parentPackage = "Global Scope";
}
else
{
model = QString(mpParentClassTextBox->text()).append(".").append(mpNameTextBox->text());
parentPackage = QString("in Package '").append(mpParentClassTextBox->text()).append("'");
model = QString(mpParentClassTextBox->text().trimmed()).append(".").append(mpNameTextBox->text().trimmed());
parentPackage = QString("in Package '").append(mpParentClassTextBox->text().trimmed()).append("'");
}
// Check whether model exists or not.
if (mpMainWindow->getOMCProxy()->existClass(model))
Expand All @@ -402,7 +402,7 @@ void ModelicaClassDialog::createModelicaClass()
modelicaClass.append(mpSpecializationComboBox->currentText().toLower());
if (mpParentClassTextBox->text().isEmpty())
{
if (!mpMainWindow->getOMCProxy()->createClass(modelicaClass, mpNameTextBox->text(), mpExtendsClassTextBox->text()))
if (!mpMainWindow->getOMCProxy()->createClass(modelicaClass, mpNameTextBox->text().trimmed(), mpExtendsClassTextBox->text().trimmed()))
{
QMessageBox::critical(this, QString(Helper::applicationName).append(" - ").append(Helper::error), GUIMessages::getMessage(
GUIMessages::ERROR_OCCURRED).arg(mpMainWindow->getOMCProxy()->getResult()).append("\n\n").
Expand All @@ -412,7 +412,7 @@ void ModelicaClassDialog::createModelicaClass()
}
else
{
if(!mpMainWindow->getOMCProxy()->createSubClass(modelicaClass, mpNameTextBox->text(), mpParentClassTextBox->text(), mpExtendsClassTextBox->text()))
if(!mpMainWindow->getOMCProxy()->createSubClass(modelicaClass, mpNameTextBox->text().trimmed(), mpParentClassTextBox->text().trimmed(), mpExtendsClassTextBox->text().trimmed()))
{
QMessageBox::critical(this, QString(Helper::applicationName).append(" - ").append(Helper::error), GUIMessages::getMessage(
GUIMessages::ERROR_OCCURRED).arg(mpMainWindow->getOMCProxy()->getResult()).append("\n\n").
Expand All @@ -422,9 +422,9 @@ void ModelicaClassDialog::createModelicaClass()
}
//open the new tab in central widget and add the model to library tree.
LibraryTreeNode *pLibraryTreeNode;
pLibraryTreeNode = pLibraryTreeWidget->addLibraryTreeNode(mpNameTextBox->text(),
pLibraryTreeNode = pLibraryTreeWidget->addLibraryTreeNode(mpNameTextBox->text().trimmed(),
StringHandler::getModelicaClassType(mpSpecializationComboBox->currentText()),
mpParentClassTextBox->text(), false);
mpParentClassTextBox->text().trimmed(), false);
pLibraryTreeNode->setSaveContentsType(mpSaveContentsInOneFileCheckBox->isChecked() ? LibraryTreeNode::SaveInOneFile : LibraryTreeNode::SaveFolderStructure);
pLibraryTreeWidget->addToExpandedLibraryTreeNodesList(pLibraryTreeNode);
pLibraryTreeWidget->showModelWidget(pLibraryTreeNode, true, !mpExtendsClassTextBox->text().isEmpty());
Expand Down

0 comments on commit 4103dcb

Please sign in to comment.