Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

style fixes

  • Loading branch information...
commit 15f9409c6532efc975e8e5c4d74b80450601508a 1 parent b8abbef
Tatiana Agapova authored
4 qrgui/mainwindow/mainwindow.pri
View
@@ -19,8 +19,8 @@ HEADERS += \
mainwindow/projectManager/autosaver.h \
mainwindow/externBrowser.h \
mainwindow/mainWindowDockInterface.h \
- mainwindow/qscintillaTextEdit.h \
- mainwindow/shapeEdit/visibilityValueWidget.h
+ mainwindow/qscintillaTextEdit.h \
+ mainwindow/shapeEdit/visibilityValueWidget.h
SOURCES += \
mainwindow/mainWindow.cpp \
4 qrgui/mainwindow/shapeEdit/item.cpp
View
@@ -233,7 +233,7 @@ void Item::setVisibilityCondition(QString const &property, QString const &sign,
mVisibilityCondition.value = value;
}
-Item::VisibilityCondition Item::visibilityCondition()
+Item::VisibilityCondition Item::visibilityCondition() const
{
return mVisibilityCondition;
}
@@ -242,7 +242,7 @@ QPair<QDomElement, Item::DomElementTypes> Item::generateDom(QDomDocument &docume
{
QPair<QDomElement, Item::DomElementTypes> result = generateItem(document, topLeftPicture);
- if (mVisibilityCondition.property != QString() && mVisibilityCondition.value != QString()) {
+ if (!mVisibilityCondition.property.isEmpty() && !mVisibilityCondition.value.isEmpty()) {
QDomElement visibility = document.createElement("showIf");
result.first.appendChild(visibility);
visibility.setAttribute("property", mVisibilityCondition.property);
2  qrgui/mainwindow/shapeEdit/item.h
View
@@ -74,7 +74,7 @@ class Item : public graphicsUtils::AbstractItem
void setVisibilityCondition(VisibilityCondition const &condition);
void setVisibilityCondition(QString const &property, QString const &sign, QString const &value);
- VisibilityCondition visibilityCondition();
+ VisibilityCondition visibilityCondition() const;
protected:
QList<QPair<ScalingPointState, QColor> > mListScalePoint;
2  qrgui/mainwindow/shapeEdit/visibilityConditionsDialog.cpp
View
@@ -68,7 +68,7 @@ void VisibilityConditionsDialog::setWidgetValues()
}
}
-bool VisibilityConditionsDialog::areValuesEqual()
+bool VisibilityConditionsDialog::areValuesEqual() const
{
Item::VisibilityCondition value = mItems.first()->visibilityCondition();
foreach (Item *item, mItems) {
2  qrgui/mainwindow/shapeEdit/visibilityConditionsDialog.h
View
@@ -33,7 +33,7 @@ private slots:
private:
void setWidgetValues();
- bool areValuesEqual();
+ bool areValuesEqual() const;
void changeOperators(Type type);
Ui::VisibilityConditionsDialog *ui;
23 qrgui/umllib/sdfRenderer.cpp
View
@@ -152,27 +152,22 @@ bool SdfRenderer::checkCondition(QDomElement const &condition) const
if (sign == "=~") {
return QRegExp(conditionValue).exactMatch(realValue);
- }
- if (sign == ">") {
+ } else if (sign == ">") {
return realValue.toInt() > conditionValue.toInt();
- }
- if (sign == "<") {
+ } else if (sign == "<") {
return realValue.toInt() < conditionValue.toInt();
- }
- if (sign == ">=") {
+ } else if (sign == ">=") {
return realValue.toInt() >= conditionValue.toInt();
- }
- if (sign == "<=") {
+ } else if (sign == "<=") {
return realValue.toInt() <= conditionValue.toInt();
- }
- if (sign == "!=") {
+ } else if (sign == "!=") {
return realValue != conditionValue;
- }
- if (sign == "=") {
+ } else if (sign == "=") {
return realValue == conditionValue;
+ } else {
+ qDebug() << "Unsupported logical operator \"" + sign + "\"";
+ return false;
}
- qDebug() << "Unsupported logical operator \"" + sign + "\"";
- return false;
}
void SdfRenderer::line(QDomElement &element)
Please sign in to comment.
Something went wrong with that request. Please try again.