ModelEditor: rename a lot of boolean attributes to m_is...

Change-Id: I4e4711d480de37b85870e18b89b035ba05be3ddd
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Jochen Becher
2015-11-12 20:25:36 +01:00
parent 356de5e26d
commit adb24b74bb
50 changed files with 282 additions and 282 deletions

View File

@@ -38,7 +38,7 @@ namespace qmt {
DAnnotation::DAnnotation() DAnnotation::DAnnotation()
: DElement(), : DElement(),
m_visualRole(RoleNormal), m_visualRole(RoleNormal),
m_autoSized(true) m_isAutoSized(true)
{ {
} }
@@ -48,7 +48,7 @@ DAnnotation::DAnnotation(const DAnnotation &rhs)
m_pos(rhs.m_pos), m_pos(rhs.m_pos),
m_rect(rhs.m_rect), m_rect(rhs.m_rect),
m_visualRole(rhs.m_visualRole), m_visualRole(rhs.m_visualRole),
m_autoSized(rhs.m_autoSized) m_isAutoSized(rhs.m_isAutoSized)
{ {
} }
@@ -64,7 +64,7 @@ DAnnotation &DAnnotation::operator=(const DAnnotation &rhs)
m_pos = rhs.m_pos; m_pos = rhs.m_pos;
m_rect = rhs.m_rect; m_rect = rhs.m_rect;
m_visualRole = rhs.m_visualRole; m_visualRole = rhs.m_visualRole;
m_autoSized = rhs.m_autoSized; m_isAutoSized = rhs.m_isAutoSized;
} }
return *this; return *this;
} }
@@ -89,9 +89,9 @@ void DAnnotation::setVisualRole(DAnnotation::VisualRole visualRole)
m_visualRole = visualRole; m_visualRole = visualRole;
} }
void DAnnotation::setAutoSize(bool autoSized) void DAnnotation::setAutoSized(bool autoSized)
{ {
m_autoSized = autoSized; m_isAutoSized = autoSized;
} }
void DAnnotation::accept(DVisitor *visitor) void DAnnotation::accept(DVisitor *visitor)

View File

@@ -84,9 +84,9 @@ public:
void setVisualRole(VisualRole visualRole); void setVisualRole(VisualRole visualRole);
bool hasAutoSize() const { return m_autoSized; } bool isAutoSized() const { return m_isAutoSized; }
void setAutoSize(bool autoSized); void setAutoSized(bool autoSized);
public: public:
@@ -104,7 +104,7 @@ private:
VisualRole m_visualRole; VisualRole m_visualRole;
bool m_autoSized; bool m_isAutoSized;
}; };

View File

@@ -38,7 +38,7 @@ namespace qmt {
DAssociationEnd::DAssociationEnd() DAssociationEnd::DAssociationEnd()
: m_kind(MAssociationEnd::Association), : m_kind(MAssociationEnd::Association),
m_navigable(false) m_isNavigable(false)
{ {
} }
@@ -58,7 +58,7 @@ void DAssociationEnd::setCardinatlity(const QString &cardinality)
void DAssociationEnd::setNavigable(bool navigable) void DAssociationEnd::setNavigable(bool navigable)
{ {
m_navigable = navigable; m_isNavigable = navigable;
} }
void DAssociationEnd::setKind(MAssociationEnd::Kind kind) void DAssociationEnd::setKind(MAssociationEnd::Kind kind)

View File

@@ -59,7 +59,7 @@ public:
void setKind(MAssociationEnd::Kind kind); void setKind(MAssociationEnd::Kind kind);
bool isNavigable() const { return m_navigable; } bool isNavigable() const { return m_isNavigable; }
void setNavigable(bool navigable); void setNavigable(bool navigable);
@@ -71,7 +71,7 @@ private:
MAssociationEnd::Kind m_kind; MAssociationEnd::Kind m_kind;
bool m_navigable; bool m_isNavigable;
}; };

View File

@@ -38,13 +38,13 @@ namespace qmt {
DComponent::DComponent() DComponent::DComponent()
: DObject(), : DObject(),
m_plainShape(false) m_isPlainShape(false)
{ {
} }
void DComponent::setPlainShape(bool planeShape) void DComponent::setPlainShape(bool planeShape)
{ {
m_plainShape = planeShape; m_isPlainShape = planeShape;
} }
void DComponent::accept(DVisitor *visitor) void DComponent::accept(DVisitor *visitor)

View File

@@ -44,7 +44,7 @@ public:
public: public:
bool plainShape() const { return m_plainShape; } bool isPlainShape() const { return m_isPlainShape; }
void setPlainShape(bool planeShape); void setPlainShape(bool planeShape);
@@ -56,7 +56,7 @@ public:
private: private:
bool m_plainShape; bool m_isPlainShape;
}; };
} }

View File

@@ -38,7 +38,7 @@ namespace qmt {
DItem::DItem() DItem::DItem()
: DObject(), : DObject(),
m_shapeEditable(true) m_isShapeEditable(true)
{ {
} }
@@ -58,7 +58,7 @@ void DItem::setShape(const QString &shape)
void DItem::setShapeEditable(bool shapeEditable) void DItem::setShapeEditable(bool shapeEditable)
{ {
m_shapeEditable = shapeEditable; m_isShapeEditable = shapeEditable;
} }
void DItem::accept(DVisitor *visitor) void DItem::accept(DVisitor *visitor)

View File

@@ -55,7 +55,7 @@ public:
void setShape(const QString &shape); void setShape(const QString &shape);
bool isShapeEditable() const { return m_shapeEditable; } bool isShapeEditable() const { return m_isShapeEditable; }
void setShapeEditable(bool shapeEditable); void setShapeEditable(bool shapeEditable);
@@ -71,7 +71,7 @@ private:
QString m_shape; QString m_shape;
bool m_shapeEditable; bool m_isShapeEditable;
}; };

View File

@@ -42,8 +42,8 @@ DObject::DObject()
m_visualPrimaryRole(PrimaryRoleNormal), m_visualPrimaryRole(PrimaryRoleNormal),
m_visualSecondaryRole(SecondaryRoleNone), m_visualSecondaryRole(SecondaryRoleNone),
m_stereotypeDisplay(StereotypeSmart), m_stereotypeDisplay(StereotypeSmart),
m_autoSized(true), m_isAutoSized(true),
m_visualEmphasized(false) m_isVisualEmphasized(false)
{ {
} }
@@ -59,8 +59,8 @@ DObject::DObject(const DObject &rhs)
m_visualPrimaryRole(rhs.m_visualPrimaryRole), m_visualPrimaryRole(rhs.m_visualPrimaryRole),
m_visualSecondaryRole(rhs.m_visualSecondaryRole), m_visualSecondaryRole(rhs.m_visualSecondaryRole),
m_stereotypeDisplay(rhs.m_stereotypeDisplay), m_stereotypeDisplay(rhs.m_stereotypeDisplay),
m_autoSized(rhs.m_autoSized), m_isAutoSized(rhs.m_isAutoSized),
m_visualEmphasized(rhs.m_visualEmphasized) m_isVisualEmphasized(rhs.m_isVisualEmphasized)
{ {
} }
@@ -82,8 +82,8 @@ DObject &DObject::operator =(const DObject &rhs)
m_visualPrimaryRole = rhs.m_visualPrimaryRole; m_visualPrimaryRole = rhs.m_visualPrimaryRole;
m_visualSecondaryRole = rhs.m_visualSecondaryRole; m_visualSecondaryRole = rhs.m_visualSecondaryRole;
m_stereotypeDisplay = rhs.m_stereotypeDisplay; m_stereotypeDisplay = rhs.m_stereotypeDisplay;
m_autoSized = rhs.m_autoSized; m_isAutoSized = rhs.m_isAutoSized;
m_visualEmphasized = rhs.m_visualEmphasized; m_isVisualEmphasized = rhs.m_isVisualEmphasized;
} }
return *this; return *this;
} }
@@ -138,14 +138,14 @@ void DObject::setStereotypeDisplay(DObject::StereotypeDisplay stereotypeDisplay)
m_stereotypeDisplay = stereotypeDisplay; m_stereotypeDisplay = stereotypeDisplay;
} }
void DObject::setAutoSize(bool autoSized) void DObject::setAutoSized(bool autoSized)
{ {
m_autoSized = autoSized; m_isAutoSized = autoSized;
} }
void DObject::setVisualEmphasized(bool visualEmphasized) void DObject::setVisualEmphasized(bool visualEmphasized)
{ {
m_visualEmphasized = visualEmphasized; m_isVisualEmphasized = visualEmphasized;
} }
void DObject::accept(DVisitor *visitor) void DObject::accept(DVisitor *visitor)

View File

@@ -132,11 +132,11 @@ public:
void setStereotypeDisplay(StereotypeDisplay stereotypeDisplay); void setStereotypeDisplay(StereotypeDisplay stereotypeDisplay);
bool hasAutoSize() const { return m_autoSized; } bool isAutoSized() const { return m_isAutoSized; }
void setAutoSize(bool autoSized); void setAutoSized(bool autoSized);
bool isVisualEmphasized() const { return m_visualEmphasized; } bool isVisualEmphasized() const { return m_isVisualEmphasized; }
void setVisualEmphasized(bool visualEmphasized); void setVisualEmphasized(bool visualEmphasized);
@@ -168,9 +168,9 @@ private:
StereotypeDisplay m_stereotypeDisplay; StereotypeDisplay m_stereotypeDisplay;
bool m_autoSized; bool m_isAutoSized;
bool m_visualEmphasized; bool m_isVisualEmphasized;
}; };
} }

View File

@@ -69,7 +69,7 @@ void DFlatAssignmentVisitor::visitDObject(const DObject *object)
target->setName(object->name()); target->setName(object->name());
target->setPos(object->pos()); target->setPos(object->pos());
target->setRect(object->rect()); target->setRect(object->rect());
target->setAutoSize(object->hasAutoSize()); target->setAutoSized(object->isAutoSized());
target->setDepth(object->depth()); target->setDepth(object->depth());
target->setVisualPrimaryRole(object->visualPrimaryRole()); target->setVisualPrimaryRole(object->visualPrimaryRole());
target->setVisualSecondaryRole(object->visualSecondaryRole()); target->setVisualSecondaryRole(object->visualSecondaryRole());
@@ -100,7 +100,7 @@ void DFlatAssignmentVisitor::visitDComponent(const DComponent *component)
visitDObject(component); visitDObject(component);
DComponent *target = dynamic_cast<DComponent *>(m_target); DComponent *target = dynamic_cast<DComponent *>(m_target);
QMT_CHECK(target); QMT_CHECK(target);
target->setPlainShape(component->plainShape()); target->setPlainShape(component->isPlainShape());
} }
void DFlatAssignmentVisitor::visitDDiagram(const DDiagram *diagram) void DFlatAssignmentVisitor::visitDDiagram(const DDiagram *diagram)
@@ -156,7 +156,7 @@ void DFlatAssignmentVisitor::visitDAnnotation(const DAnnotation *annotation)
target->setText(annotation->text()); target->setText(annotation->text());
target->setPos(annotation->pos()); target->setPos(annotation->pos());
target->setRect(annotation->rect()); target->setRect(annotation->rect());
target->setAutoSize(annotation->hasAutoSize()); target->setAutoSized(annotation->isAutoSized());
target->setVisualRole(annotation->visualRole()); target->setVisualRole(annotation->visualRole());
} }

View File

@@ -885,7 +885,7 @@ void DiagramController::updateElementFromModel(DElement *element, const MDiagram
if (emitUpdateSignal) { if (emitUpdateSignal) {
visitor.setCheckNeedsUpdate(true); visitor.setCheckNeedsUpdate(true);
melement->accept(&visitor); melement->accept(&visitor);
if (visitor.updateNeeded()) { if (visitor.isUpdateNeeded()) {
int row = diagram->diagramElements().indexOf(element); int row = diagram->diagramElements().indexOf(element);
emit beginUpdateElement(row, diagram); emit beginUpdateElement(row, diagram);
visitor.setCheckNeedsUpdate(false); visitor.setCheckNeedsUpdate(false);

View File

@@ -58,14 +58,14 @@ DUpdateVisitor::DUpdateVisitor(DElement *target, const MDiagram *diagram, bool c
: m_target(target), : m_target(target),
m_diagram(diagram), m_diagram(diagram),
m_checkNeedsUpdate(checkNeedsUpdate), m_checkNeedsUpdate(checkNeedsUpdate),
m_updateNeeded(!checkNeedsUpdate) m_isUpdateNeeded(!checkNeedsUpdate)
{ {
} }
void DUpdateVisitor::setCheckNeedsUpdate(bool checkNeedsUpdate) void DUpdateVisitor::setCheckNeedsUpdate(bool checkNeedsUpdate)
{ {
m_checkNeedsUpdate = checkNeedsUpdate; m_checkNeedsUpdate = checkNeedsUpdate;
m_updateNeeded = !checkNeedsUpdate; m_isUpdateNeeded = !checkNeedsUpdate;
} }
void DUpdateVisitor::visitMElement(const MElement *element) void DUpdateVisitor::visitMElement(const MElement *element)
@@ -214,7 +214,7 @@ bool DUpdateVisitor::isUpdating(bool valueChanged)
{ {
if (m_checkNeedsUpdate) { if (m_checkNeedsUpdate) {
if (valueChanged) { if (valueChanged) {
m_updateNeeded = true; m_isUpdateNeeded = true;
} }
return false; return false;
} }

View File

@@ -48,7 +48,7 @@ public:
public: public:
bool updateNeeded() const { return m_updateNeeded; } bool isUpdateNeeded() const { return m_isUpdateNeeded; }
void setCheckNeedsUpdate(bool checkNeedsUpdate); void setCheckNeedsUpdate(bool checkNeedsUpdate);
@@ -88,7 +88,7 @@ private:
bool m_checkNeedsUpdate; bool m_checkNeedsUpdate;
bool m_updateNeeded; bool m_isUpdateNeeded;
}; };
} }

View File

@@ -81,13 +81,13 @@ AnnotationItem::AnnotationItem(DAnnotation *annotation, DiagramSceneModel *diagr
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_annotation(annotation), m_annotation(annotation),
m_diagramSceneModel(diagramSceneModel), m_diagramSceneModel(diagramSceneModel),
m_secondarySelected(false), m_isSecondarySelected(false),
m_focusSelected(false), m_isFocusSelected(false),
m_selectionMarker(0), m_selectionMarker(0),
m_noTextItem(0), m_noTextItem(0),
m_textItem(0), m_textItem(0),
m_onUpdate(false), m_isUpdating(false),
m_onChanged(false) m_isChanged(false)
{ {
setFlags(QGraphicsItem::ItemIsSelectable); setFlags(QGraphicsItem::ItemIsSelectable);
} }
@@ -110,8 +110,8 @@ void AnnotationItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
void AnnotationItem::update() void AnnotationItem::update()
{ {
QMT_CHECK(!m_onUpdate); QMT_CHECK(!m_isUpdating);
m_onUpdate = true; m_isUpdating = true;
prepareGeometryChange(); prepareGeometryChange();
@@ -127,7 +127,7 @@ void AnnotationItem::update()
} }
m_textItem->setFont(style->normalFont()); m_textItem->setFont(style->normalFont());
m_textItem->setDefaultTextColor(style->textBrush().color()); m_textItem->setDefaultTextColor(style->textBrush().color());
if (!m_onChanged) { if (!m_isChanged) {
m_textItem->setPlainText(annotation()->text()); m_textItem->setPlainText(annotation()->text());
} }
@@ -144,7 +144,7 @@ void AnnotationItem::update()
setZValue(ANNOTATION_ITEMS_ZVALUE); setZValue(ANNOTATION_ITEMS_ZVALUE);
m_onUpdate = false; m_isUpdating = false;
} }
QPointF AnnotationItem::pos() const QPointF AnnotationItem::pos() const
@@ -171,7 +171,7 @@ void AnnotationItem::setPosAndRect(const QPointF &originalPos, const QRectF &ori
m_diagramSceneModel->diagramController()->startUpdateElement(m_annotation, m_diagramSceneModel->diagram(), DiagramController::UpdateGeometry); m_diagramSceneModel->diagramController()->startUpdateElement(m_annotation, m_diagramSceneModel->diagram(), DiagramController::UpdateGeometry);
m_annotation->setPos(newPos); m_annotation->setPos(newPos);
if (newRect.size() != m_annotation->rect().size()) { if (newRect.size() != m_annotation->rect().size()) {
m_annotation->setAutoSize(false); m_annotation->setAutoSized(false);
} }
m_annotation->setRect(newRect); m_annotation->setRect(newRect);
m_diagramSceneModel->diagramController()->finishUpdateElement(m_annotation, m_diagramSceneModel->diagram(), false); m_diagramSceneModel->diagramController()->finishUpdateElement(m_annotation, m_diagramSceneModel->diagram(), false);
@@ -208,26 +208,26 @@ void AnnotationItem::alignItemPositionToRaster(double rasterWidth, double raster
bool AnnotationItem::isSecondarySelected() const bool AnnotationItem::isSecondarySelected() const
{ {
return m_secondarySelected; return m_isSecondarySelected;
} }
void AnnotationItem::setSecondarySelected(bool secondarySelected) void AnnotationItem::setSecondarySelected(bool secondarySelected)
{ {
if (m_secondarySelected != secondarySelected) { if (m_isSecondarySelected != secondarySelected) {
m_secondarySelected = secondarySelected; m_isSecondarySelected = secondarySelected;
update(); update();
} }
} }
bool AnnotationItem::isFocusSelected() const bool AnnotationItem::isFocusSelected() const
{ {
return m_focusSelected; return m_isFocusSelected;
} }
void AnnotationItem::setFocusSelected(bool focusSelected) void AnnotationItem::setFocusSelected(bool focusSelected)
{ {
if (m_focusSelected != focusSelected) { if (m_isFocusSelected != focusSelected) {
m_focusSelected = focusSelected; m_isFocusSelected = focusSelected;
update(); update();
} }
} }
@@ -273,13 +273,13 @@ void AnnotationItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void AnnotationItem::updateSelectionMarker() void AnnotationItem::updateSelectionMarker()
{ {
if (isSelected() || m_secondarySelected) { if (isSelected() || m_isSecondarySelected) {
if (!m_selectionMarker) { if (!m_selectionMarker) {
m_selectionMarker = new RectangularSelectionItem(this, this); m_selectionMarker = new RectangularSelectionItem(this, this);
m_selectionMarker->setShowBorder(true); m_selectionMarker->setShowBorder(true);
m_selectionMarker->setFreedom(RectangularSelectionItem::FreedomHorizontalOnly); m_selectionMarker->setFreedom(RectangularSelectionItem::FreedomHorizontalOnly);
} }
m_selectionMarker->setSecondarySelected(isSelected() ? false : m_secondarySelected); m_selectionMarker->setSecondarySelected(isSelected() ? false : m_isSecondarySelected);
} else if (m_selectionMarker) { } else if (m_selectionMarker) {
if (m_selectionMarker->scene()) { if (m_selectionMarker->scene()) {
m_selectionMarker->scene()->removeItem(m_selectionMarker); m_selectionMarker->scene()->removeItem(m_selectionMarker);
@@ -314,10 +314,10 @@ bool AnnotationItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
void AnnotationItem::onContentsChanged() void AnnotationItem::onContentsChanged()
{ {
QMT_CHECK(!m_onChanged); QMT_CHECK(!m_isChanged);
m_onChanged = true; m_isChanged = true;
if (!m_onUpdate) { if (!m_isUpdating) {
QString plainText = m_textItem->toPlainText(); QString plainText = m_textItem->toPlainText();
if (m_annotation->text() != plainText) { if (m_annotation->text() != plainText) {
m_diagramSceneModel->diagramController()->startUpdateElement(m_annotation, m_diagramSceneModel->diagram(), DiagramController::UpdateMinor); m_diagramSceneModel->diagramController()->startUpdateElement(m_annotation, m_diagramSceneModel->diagram(), DiagramController::UpdateMinor);
@@ -326,7 +326,7 @@ void AnnotationItem::onContentsChanged()
} }
} }
m_onChanged = false; m_isChanged = false;
} }
QSizeF AnnotationItem::calcMinimumGeometry() const QSizeF AnnotationItem::calcMinimumGeometry() const
@@ -334,7 +334,7 @@ QSizeF AnnotationItem::calcMinimumGeometry() const
qreal width = MINIMUM_TEXT_WIDTH + 2 * CONTENTS_BORDER_HORIZONTAL; qreal width = MINIMUM_TEXT_WIDTH + 2 * CONTENTS_BORDER_HORIZONTAL;
qreal height = 0.0; // irrelevant; cannot be modified by user and will always be overwritten qreal height = 0.0; // irrelevant; cannot be modified by user and will always be overwritten
if (annotation()->hasAutoSize()) { if (annotation()->isAutoSized()) {
if (m_textItem) { if (m_textItem) {
m_textItem->setTextWidth(-1); m_textItem->setTextWidth(-1);
QSizeF textSize = m_textItem->document()->size(); QSizeF textSize = m_textItem->document()->size();
@@ -352,7 +352,7 @@ void AnnotationItem::updateGeometry()
qreal width = geometry.width(); qreal width = geometry.width();
qreal height = geometry.height(); qreal height = geometry.height();
if (annotation()->hasAutoSize()) { if (annotation()->isAutoSized()) {
if (m_textItem) { if (m_textItem) {
m_textItem->setTextWidth(-1); m_textItem->setTextWidth(-1);
QSizeF textSize = m_textItem->document()->size(); QSizeF textSize = m_textItem->document()->size();

View File

@@ -146,9 +146,9 @@ private:
DiagramSceneModel *m_diagramSceneModel; DiagramSceneModel *m_diagramSceneModel;
bool m_secondarySelected; bool m_isSecondarySelected;
bool m_focusSelected; bool m_isFocusSelected;
RectangularSelectionItem *m_selectionMarker; RectangularSelectionItem *m_selectionMarker;
@@ -156,9 +156,9 @@ private:
AnnotationTextItem *m_textItem; AnnotationTextItem *m_textItem;
bool m_onUpdate; bool m_isUpdating;
bool m_onChanged; bool m_isChanged;
}; };
} }

View File

@@ -83,14 +83,14 @@ BoundaryItem::BoundaryItem(DBoundary *boundary, DiagramSceneModel *diagramSceneM
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_boundary(boundary), m_boundary(boundary),
m_diagramSceneModel(diagramSceneModel), m_diagramSceneModel(diagramSceneModel),
m_secondarySelected(false), m_isSecondarySelected(false),
m_focusSelected(false), m_isFocusSelected(false),
m_selectionMarker(0), m_selectionMarker(0),
m_borderItem(0), m_borderItem(0),
m_noTextItem(0), m_noTextItem(0),
m_textItem(0), m_textItem(0),
m_onUpdate(false), m_isUpdating(false),
m_onChanged(false) m_isChanged(false)
{ {
setFlags(QGraphicsItem::ItemIsSelectable); setFlags(QGraphicsItem::ItemIsSelectable);
} }
@@ -113,8 +113,8 @@ void BoundaryItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
void BoundaryItem::update() void BoundaryItem::update()
{ {
QMT_CHECK(!m_onUpdate); QMT_CHECK(!m_isUpdating);
m_onUpdate = true; m_isUpdating = true;
prepareGeometryChange(); prepareGeometryChange();
@@ -130,7 +130,7 @@ void BoundaryItem::update()
} }
m_textItem->setFont(style->normalFont()); m_textItem->setFont(style->normalFont());
m_textItem->setDefaultTextColor(style->textBrush().color()); m_textItem->setDefaultTextColor(style->textBrush().color());
if (!m_onChanged) { if (!m_isChanged) {
m_textItem->setTextWidth(-1); m_textItem->setTextWidth(-1);
m_textItem->setPlainText(m_boundary->text()); m_textItem->setPlainText(m_boundary->text());
} }
@@ -159,7 +159,7 @@ void BoundaryItem::update()
setZValue(BOUNDARY_ITEMS_ZVALUE); setZValue(BOUNDARY_ITEMS_ZVALUE);
m_onUpdate = false; m_isUpdating = false;
} }
QPointF BoundaryItem::pos() const QPointF BoundaryItem::pos() const
@@ -261,26 +261,26 @@ void BoundaryItem::alignItemPositionToRaster(double rasterWidth, double rasterHe
bool BoundaryItem::isSecondarySelected() const bool BoundaryItem::isSecondarySelected() const
{ {
return m_secondarySelected; return m_isSecondarySelected;
} }
void BoundaryItem::setSecondarySelected(bool secondarySelected) void BoundaryItem::setSecondarySelected(bool secondarySelected)
{ {
if (m_secondarySelected != secondarySelected) { if (m_isSecondarySelected != secondarySelected) {
m_secondarySelected = secondarySelected; m_isSecondarySelected = secondarySelected;
update(); update();
} }
} }
bool BoundaryItem::isFocusSelected() const bool BoundaryItem::isFocusSelected() const
{ {
return m_focusSelected; return m_isFocusSelected;
} }
void BoundaryItem::setFocusSelected(bool focusSelected) void BoundaryItem::setFocusSelected(bool focusSelected)
{ {
if (m_focusSelected != focusSelected) { if (m_isFocusSelected != focusSelected) {
m_focusSelected = focusSelected; m_isFocusSelected = focusSelected;
update(); update();
} }
} }
@@ -326,11 +326,11 @@ void BoundaryItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void BoundaryItem::updateSelectionMarker() void BoundaryItem::updateSelectionMarker()
{ {
if (isSelected() || m_secondarySelected) { if (isSelected() || m_isSecondarySelected) {
if (!m_selectionMarker) { if (!m_selectionMarker) {
m_selectionMarker = new RectangularSelectionItem(this, this); m_selectionMarker = new RectangularSelectionItem(this, this);
} }
m_selectionMarker->setSecondarySelected(isSelected() ? false : m_secondarySelected); m_selectionMarker->setSecondarySelected(isSelected() ? false : m_isSecondarySelected);
} else if (m_selectionMarker) { } else if (m_selectionMarker) {
if (m_selectionMarker->scene()) { if (m_selectionMarker->scene()) {
m_selectionMarker->scene()->removeItem(m_selectionMarker); m_selectionMarker->scene()->removeItem(m_selectionMarker);
@@ -365,10 +365,10 @@ bool BoundaryItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
void BoundaryItem::onContentsChanged() void BoundaryItem::onContentsChanged()
{ {
QMT_CHECK(!m_onChanged); QMT_CHECK(!m_isChanged);
m_onChanged = true; m_isChanged = true;
if (!m_onUpdate) { if (!m_isUpdating) {
QString plainText = m_textItem->toPlainText(); QString plainText = m_textItem->toPlainText();
if (m_boundary->text() != plainText) { if (m_boundary->text() != plainText) {
m_diagramSceneModel->diagramController()->startUpdateElement(m_boundary, m_diagramSceneModel->diagram(), DiagramController::UpdateMinor); m_diagramSceneModel->diagramController()->startUpdateElement(m_boundary, m_diagramSceneModel->diagram(), DiagramController::UpdateMinor);
@@ -377,7 +377,7 @@ void BoundaryItem::onContentsChanged()
} }
} }
m_onChanged = false; m_isChanged = false;
} }
QSizeF BoundaryItem::calcMinimumGeometry() const QSizeF BoundaryItem::calcMinimumGeometry() const

View File

@@ -145,9 +145,9 @@ private:
DiagramSceneModel *m_diagramSceneModel; DiagramSceneModel *m_diagramSceneModel;
bool m_secondarySelected; bool m_isSecondarySelected;
bool m_focusSelected; bool m_isFocusSelected;
RectangularSelectionItem *m_selectionMarker; RectangularSelectionItem *m_selectionMarker;
@@ -157,9 +157,9 @@ private:
BoundaryTextItem *m_textItem; BoundaryTextItem *m_textItem;
bool m_onUpdate; bool m_isUpdating;
bool m_onChanged; bool m_isChanged;
}; };
} }

View File

@@ -434,7 +434,7 @@ void ClassItem::updateGeometry()
width = geometry.width(); width = geometry.width();
height = geometry.height(); height = geometry.height();
if (object()->hasAutoSize()) { if (object()->isAutoSized()) {
if (!m_customIcon) { if (!m_customIcon) {
if (width < MINIMUM_AUTO_WIDTH) { if (width < MINIMUM_AUTO_WIDTH) {
width = MINIMUM_AUTO_WIDTH; width = MINIMUM_AUTO_WIDTH;

View File

@@ -281,7 +281,7 @@ bool ComponentItem::hasPlainShape() const
{ {
DComponent *diagramComponent = dynamic_cast<DComponent *>(object()); DComponent *diagramComponent = dynamic_cast<DComponent *>(object());
QMT_CHECK(diagramComponent); QMT_CHECK(diagramComponent);
return diagramComponent->plainShape(); return diagramComponent->isPlainShape();
} }
QSizeF ComponentItem::calcMinimumGeometry() const QSizeF ComponentItem::calcMinimumGeometry() const
@@ -336,7 +336,7 @@ void ComponentItem::updateGeometry()
width = geometry.width(); width = geometry.width();
height = geometry.height(); height = geometry.height();
if (object()->hasAutoSize()) { if (object()->isAutoSized()) {
// nothing // nothing
} else { } else {
QRectF rect = object()->rect(); QRectF rect = object()->rect();

View File

@@ -203,7 +203,7 @@ void DiagramItem::updateGeometry()
width = geometry.width(); width = geometry.width();
height = geometry.height(); height = geometry.height();
if (object()->hasAutoSize()) { if (object()->isAutoSized()) {
if (!m_customIcon) { if (!m_customIcon) {
if (width < MINIMUM_AUTO_WIDTH) { if (width < MINIMUM_AUTO_WIDTH) {
width = MINIMUM_AUTO_WIDTH; width = MINIMUM_AUTO_WIDTH;

View File

@@ -259,7 +259,7 @@ void ItemItem::updateGeometry()
width = geometry.width(); width = geometry.width();
height = geometry.height(); height = geometry.height();
if (object()->hasAutoSize()) { if (object()->isAutoSized()) {
// nothing // nothing
} else { } else {
QRectF rect = object()->rect(); QRectF rect = object()->rect();

View File

@@ -66,8 +66,8 @@ ObjectItem::ObjectItem(DObject *object, DiagramSceneModel *diagramSceneModel, QG
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_object(object), m_object(object),
m_diagramSceneModel(diagramSceneModel), m_diagramSceneModel(diagramSceneModel),
m_secondarySelected(false), m_isSecondarySelected(false),
m_focusSelected(false), m_isFocusSelected(false),
m_stereotypeIconDisplay(StereotypeIcon::DisplayLabel), m_stereotypeIconDisplay(StereotypeIcon::DisplayLabel),
m_stereotypes(0), m_stereotypes(0),
m_stereotypeIcon(0), m_stereotypeIcon(0),
@@ -113,7 +113,7 @@ void ObjectItem::setPosAndRect(const QPointF &originalPos, const QRectF &origina
m_diagramSceneModel->diagramController()->startUpdateElement(m_object, m_diagramSceneModel->diagram(), DiagramController::UpdateGeometry); m_diagramSceneModel->diagramController()->startUpdateElement(m_object, m_diagramSceneModel->diagram(), DiagramController::UpdateGeometry);
m_object->setPos(newPos); m_object->setPos(newPos);
if (newRect.size() != m_object->rect().size()) { if (newRect.size() != m_object->rect().size()) {
m_object->setAutoSize(false); m_object->setAutoSized(false);
} }
m_object->setRect(newRect); m_object->setRect(newRect);
m_diagramSceneModel->diagramController()->finishUpdateElement(m_object, m_diagramSceneModel->diagram(), false); m_diagramSceneModel->diagramController()->finishUpdateElement(m_object, m_diagramSceneModel->diagram(), false);
@@ -191,26 +191,26 @@ void ObjectItem::alignItemPositionToRaster(double rasterWidth, double rasterHeig
bool ObjectItem::isSecondarySelected() const bool ObjectItem::isSecondarySelected() const
{ {
return m_secondarySelected; return m_isSecondarySelected;
} }
void ObjectItem::setSecondarySelected(bool secondarySelected) void ObjectItem::setSecondarySelected(bool secondarySelected)
{ {
if (m_secondarySelected != secondarySelected) { if (m_isSecondarySelected != secondarySelected) {
m_secondarySelected = secondarySelected; m_isSecondarySelected = secondarySelected;
update(); update();
} }
} }
bool ObjectItem::isFocusSelected() const bool ObjectItem::isFocusSelected() const
{ {
return m_focusSelected; return m_isFocusSelected;
} }
void ObjectItem::setFocusSelected(bool focusSelected) void ObjectItem::setFocusSelected(bool focusSelected)
{ {
if (m_focusSelected != focusSelected) { if (m_isFocusSelected != focusSelected) {
m_focusSelected = focusSelected; m_isFocusSelected = focusSelected;
update(); update();
} }
} }

View File

@@ -208,9 +208,9 @@ private:
DiagramSceneModel *m_diagramSceneModel; DiagramSceneModel *m_diagramSceneModel;
bool m_secondarySelected; bool m_isSecondarySelected;
bool m_focusSelected; bool m_isFocusSelected;
QString m_stereotypeIconId; QString m_stereotypeIconId;

View File

@@ -302,7 +302,7 @@ void PackageItem::updateGeometry()
double tabHeight = geometry.m_minimumTabSize.height(); double tabHeight = geometry.m_minimumTabSize.height();
// calc width and height // calc width and height
if (object()->hasAutoSize()) { if (object()->isAutoSized()) {
if (!m_customIcon) { if (!m_customIcon) {
if (width < MINIMUM_AUTO_WIDTH) { if (width < MINIMUM_AUTO_WIDTH) {
width = MINIMUM_AUTO_WIDTH; width = MINIMUM_AUTO_WIDTH;

View File

@@ -190,8 +190,8 @@ RelationItem::RelationItem(DRelation *relation, DiagramSceneModel *diagramSceneM
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_relation(relation), m_relation(relation),
m_diagramSceneModel(diagramSceneModel), m_diagramSceneModel(diagramSceneModel),
m_secondarySelected(false), m_isSecondarySelected(false),
m_focusSelected(false), m_isFocusSelected(false),
m_arrow(0), m_arrow(0),
m_name(0), m_name(0),
m_stereotypes(0), m_stereotypes(0),
@@ -270,26 +270,26 @@ void RelationItem::alignItemPositionToRaster(double rasterWidth, double rasterHe
bool RelationItem::isSecondarySelected() const bool RelationItem::isSecondarySelected() const
{ {
return m_secondarySelected; return m_isSecondarySelected;
} }
void RelationItem::setSecondarySelected(bool secondarySelected) void RelationItem::setSecondarySelected(bool secondarySelected)
{ {
if (m_secondarySelected != secondarySelected) { if (m_isSecondarySelected != secondarySelected) {
m_secondarySelected = secondarySelected; m_isSecondarySelected = secondarySelected;
update(); update();
} }
} }
bool RelationItem::isFocusSelected() const bool RelationItem::isFocusSelected() const
{ {
return m_focusSelected; return m_isFocusSelected;
} }
void RelationItem::setFocusSelected(bool focusSelected) void RelationItem::setFocusSelected(bool focusSelected)
{ {
if (m_focusSelected != focusSelected) { if (m_isFocusSelected != focusSelected) {
m_focusSelected = focusSelected; m_isFocusSelected = focusSelected;
update(); update();
} }
} }

View File

@@ -137,9 +137,9 @@ protected:
DiagramSceneModel *m_diagramSceneModel; DiagramSceneModel *m_diagramSceneModel;
bool m_secondarySelected; bool m_isSecondarySelected;
bool m_focusSelected; bool m_isFocusSelected;
ArrowItem *m_arrow; ArrowItem *m_arrow;

View File

@@ -152,7 +152,7 @@ PathSelectionItem::PathSelectionItem(IWindable *windable, QGraphicsItem *parent)
: QGraphicsItem(parent), : QGraphicsItem(parent),
m_windable(windable), m_windable(windable),
m_pointSize(QSizeF(8.0, 8.0)), m_pointSize(QSizeF(8.0, 8.0)),
m_secondarySelected(false) m_isSecondarySelected(false)
{ {
} }
@@ -244,8 +244,8 @@ void PathSelectionItem::setPoints(const QList<QPointF> &points)
void PathSelectionItem::setSecondarySelected(bool secondarySelected) void PathSelectionItem::setSecondarySelected(bool secondarySelected)
{ {
if (m_secondarySelected != secondarySelected) { if (m_isSecondarySelected != secondarySelected) {
m_secondarySelected = secondarySelected; m_isSecondarySelected = secondarySelected;
update(); update();
} }
} }
@@ -273,7 +273,7 @@ void PathSelectionItem::update()
foreach (GraphicsHandleItem *handle, m_handles) { foreach (GraphicsHandleItem *handle, m_handles) {
handle->setPointSize(m_pointSize); handle->setPointSize(m_pointSize);
bool isEndPoint = (i == 0 || i == m_handles.size() - 1); bool isEndPoint = (i == 0 || i == m_handles.size() - 1);
handle->setSelection(m_secondarySelected handle->setSelection(m_isSecondarySelected
? (isEndPoint ? GraphicsHandleItem::NotSelected : GraphicsHandleItem::SecondarySelected) ? (isEndPoint ? GraphicsHandleItem::NotSelected : GraphicsHandleItem::SecondarySelected)
: GraphicsHandleItem::Selected); : GraphicsHandleItem::Selected);
++i; ++i;

View File

@@ -99,7 +99,7 @@ private:
QSizeF m_pointSize; QSizeF m_pointSize;
bool m_secondarySelected; bool m_isSecondarySelected;
QList<GraphicsHandleItem *> m_handles; QList<GraphicsHandleItem *> m_handles;

View File

@@ -52,7 +52,7 @@ public:
: QGraphicsRectItem(parent), : QGraphicsRectItem(parent),
m_owner(parent), m_owner(parent),
m_handle(handle), m_handle(handle),
m_secondarySelected(false) m_isSecondarySelected(false)
{ {
setPen(QPen(Qt::black)); setPen(QPen(Qt::black));
setBrush(QBrush(Qt::black)); setBrush(QBrush(Qt::black));
@@ -60,8 +60,8 @@ public:
void setSecondarySelected(bool secondarySelected) void setSecondarySelected(bool secondarySelected)
{ {
if (secondarySelected != m_secondarySelected) { if (secondarySelected != m_isSecondarySelected) {
m_secondarySelected = secondarySelected; m_isSecondarySelected = secondarySelected;
if (secondarySelected) { if (secondarySelected) {
setPen(QPen(Qt::lightGray)); setPen(QPen(Qt::lightGray));
setBrush(Qt::NoBrush); setBrush(Qt::NoBrush);
@@ -78,7 +78,7 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) void mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
m_startPos = mapToScene(event->pos()); m_startPos = mapToScene(event->pos());
if (!m_secondarySelected) { if (!m_isSecondarySelected) {
m_owner->moveHandle(m_handle, QPointF(0.0, 0.0), Press, None); m_owner->moveHandle(m_handle, QPointF(0.0, 0.0), Press, None);
} }
} }
@@ -86,7 +86,7 @@ protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
QPointF pos = mapToScene(event->pos()) - m_startPos; QPointF pos = mapToScene(event->pos()) - m_startPos;
if (!m_secondarySelected) { if (!m_isSecondarySelected) {
m_owner->moveHandle(m_handle, pos, Move, None); m_owner->moveHandle(m_handle, pos, Move, None);
} }
@@ -95,7 +95,7 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
QPointF pos = mapToScene(event->pos()) - m_startPos; QPointF pos = mapToScene(event->pos()) - m_startPos;
if (!m_secondarySelected) { if (!m_isSecondarySelected) {
m_owner->moveHandle(m_handle, pos, Release, None); m_owner->moveHandle(m_handle, pos, Release, None);
} }
} }
@@ -106,7 +106,7 @@ private:
Handle m_handle; Handle m_handle;
bool m_secondarySelected; bool m_isSecondarySelected;
QPointF m_startPos; QPointF m_startPos;
}; };
@@ -120,7 +120,7 @@ RectangularSelectionItem::RectangularSelectionItem(IResizable *itemResizer, QGra
m_showBorder(false), m_showBorder(false),
m_borderItem(0), m_borderItem(0),
m_freedom(FreedomAny), m_freedom(FreedomAny),
m_secondarySelected(false) m_isSecondarySelected(false)
{ {
} }
@@ -173,8 +173,8 @@ void RectangularSelectionItem::setFreedom(Freedom freedom)
void RectangularSelectionItem::setSecondarySelected(bool secondarySelected) void RectangularSelectionItem::setSecondarySelected(bool secondarySelected)
{ {
if (secondarySelected != m_secondarySelected) { if (secondarySelected != m_isSecondarySelected) {
m_secondarySelected = secondarySelected; m_isSecondarySelected = secondarySelected;
update(); update();
} }
} }
@@ -216,7 +216,7 @@ void RectangularSelectionItem::update()
visible = m_freedom == FreedomAny || m_freedom == FreedomKeepRatio; visible = m_freedom == FreedomAny || m_freedom == FreedomKeepRatio;
break; break;
} }
m_points[i]->setSecondarySelected(m_secondarySelected); m_points[i]->setSecondarySelected(m_isSecondarySelected);
m_points[i]->setVisible(visible); m_points[i]->setVisible(visible);
} }
double horizCenter = (m_rect.left() + m_rect.right()) * 0.5; double horizCenter = (m_rect.left() + m_rect.right()) * 0.5;
@@ -235,7 +235,7 @@ void RectangularSelectionItem::update()
m_borderItem = new QGraphicsRectItem(this); m_borderItem = new QGraphicsRectItem(this);
} }
m_borderItem->setRect(m_rect); m_borderItem->setRect(m_rect);
if (m_secondarySelected) { if (m_isSecondarySelected) {
m_borderItem->setPen(QPen(QBrush(Qt::lightGray), 0.0, Qt::DashDotLine)); m_borderItem->setPen(QPen(QBrush(Qt::lightGray), 0.0, Qt::DashDotLine));
} else { } else {
m_borderItem->setPen(QPen(QBrush(Qt::black), 0.0, Qt::DashDotLine)); m_borderItem->setPen(QPen(QBrush(Qt::black), 0.0, Qt::DashDotLine));

View File

@@ -116,7 +116,7 @@ public:
void setFreedom(Freedom freedom); void setFreedom(Freedom freedom);
bool isSecondarySelected() const { return m_secondarySelected; } bool isSecondarySelected() const { return m_isSecondarySelected; }
void setSecondarySelected(bool secondarySelected); void setSecondarySelected(bool secondarySelected);
@@ -146,7 +146,7 @@ private:
Freedom m_freedom; Freedom m_freedom;
bool m_secondarySelected; bool m_isSecondarySelected;
}; };
} }

View File

@@ -53,19 +53,19 @@ public:
public: public:
explicit Handles(bool takeOwnership = false) : m_takeOwnership(takeOwnership) { } explicit Handles(bool takeOwnership = false) : m_takesOwnership(takeOwnership) { }
Handles(const Handles<T> &rhs) Handles(const Handles<T> &rhs)
: m_handleList(rhs.m_handleList), : m_handleList(rhs.m_handleList),
m_takeOwnership(false) m_takesOwnership(false)
{ {
} }
Handles(const Handles<T> &rhs, bool takeOwnership) Handles(const Handles<T> &rhs, bool takeOwnership)
: m_handleList(rhs.m_handleList), : m_handleList(rhs.m_handleList),
m_takeOwnership(takeOwnership) m_takesOwnership(takeOwnership)
{ {
if (m_takeOwnership && rhs.m_takeOwnership) { if (m_takesOwnership && rhs.m_takesOwnership) {
const_cast<Handles<T> &>(rhs).m_handleList.clear(); const_cast<Handles<T> &>(rhs).m_handleList.clear();
} }
} }
@@ -81,7 +81,7 @@ public:
{ {
if (this != &rhs) { if (this != &rhs) {
m_handleList = rhs.m_handleList; m_handleList = rhs.m_handleList;
if (m_takeOwnership && rhs.m_takeOwnership) { if (m_takesOwnership && rhs.m_takesOwnership) {
const_cast<Handles<T> &>(rhs).m_handleList.clear(); const_cast<Handles<T> &>(rhs).m_handleList.clear();
} }
} }
@@ -90,7 +90,7 @@ public:
public: public:
bool takesOwnership() const { return m_takeOwnership; } bool takesOwnership() const { return m_takesOwnership; }
bool isEmpty() const { return m_handleList.empty(); } bool isEmpty() const { return m_handleList.empty(); }
@@ -170,7 +170,7 @@ public:
void reset() void reset()
{ {
if (m_takeOwnership) { if (m_takesOwnership) {
foreach (const Handle<T> &handle, m_handleList) { foreach (const Handle<T> &handle, m_handleList) {
delete handle.target(); delete handle.target();
} }
@@ -218,7 +218,7 @@ public:
void remove(int index) void remove(int index)
{ {
QMT_CHECK(index >= 0 && index < size()); QMT_CHECK(index >= 0 && index < size());
if (m_takeOwnership) { if (m_takesOwnership) {
T *t = m_handleList.at(index).target(); T *t = m_handleList.at(index).target();
m_handleList.removeAt(index); m_handleList.removeAt(index);
delete t; delete t;
@@ -261,7 +261,7 @@ private:
value_type m_handleList; value_type m_handleList;
bool m_takeOwnership; bool m_takesOwnership;
}; };
template<typename T> template<typename T>

View File

@@ -38,7 +38,7 @@ namespace qmt {
MAssociationEnd::MAssociationEnd() MAssociationEnd::MAssociationEnd()
: m_kind(Association), : m_kind(Association),
m_navigable(false) m_isNavigable(false)
{ {
} }
@@ -46,7 +46,7 @@ MAssociationEnd::MAssociationEnd(const MAssociationEnd &rhs)
: m_name(rhs.m_name), : m_name(rhs.m_name),
m_cardinality(rhs.m_cardinality), m_cardinality(rhs.m_cardinality),
m_kind(rhs.m_kind), m_kind(rhs.m_kind),
m_navigable(rhs.m_navigable) m_isNavigable(rhs.m_isNavigable)
{ {
} }
@@ -60,7 +60,7 @@ MAssociationEnd &MAssociationEnd::operator =(const MAssociationEnd &rhs)
m_name = rhs.m_name; m_name = rhs.m_name;
m_cardinality = rhs.m_cardinality; m_cardinality = rhs.m_cardinality;
m_kind = rhs.m_kind; m_kind = rhs.m_kind;
m_navigable = rhs.m_navigable; m_isNavigable = rhs.m_isNavigable;
} }
return *this; return *this;
} }
@@ -82,7 +82,7 @@ void MAssociationEnd::setKind(MAssociationEnd::Kind kind)
void MAssociationEnd::setNavigable(bool navigable) void MAssociationEnd::setNavigable(bool navigable)
{ {
m_navigable = navigable; m_isNavigable = navigable;
} }
bool operator==(const MAssociationEnd &lhs, const MAssociationEnd &rhs) bool operator==(const MAssociationEnd &lhs, const MAssociationEnd &rhs)

View File

@@ -78,7 +78,7 @@ public:
void setKind(Kind kind); void setKind(Kind kind);
bool isNavigable() const { return m_navigable; } bool isNavigable() const { return m_isNavigable; }
void setNavigable(bool navigable); void setNavigable(bool navigable);
@@ -90,7 +90,7 @@ private:
Kind m_kind; Kind m_kind;
bool m_navigable; bool m_isNavigable;
}; };
bool operator==(const MAssociationEnd &lhs, const MAssociationEnd &rhs); bool operator==(const MAssociationEnd &lhs, const MAssociationEnd &rhs);

View File

@@ -38,8 +38,8 @@ namespace qmt {
MItem::MItem() MItem::MItem()
: MObject(), : MObject(),
m_varietyEditable(true), m_isVarietyEditable(true),
m_shapeEditable(false) m_isShapeEditable(false)
{ {
} }
@@ -54,12 +54,12 @@ void MItem::setVariety(const QString &variety)
void MItem::setVarietyEditable(bool varietyEditable) void MItem::setVarietyEditable(bool varietyEditable)
{ {
m_varietyEditable = varietyEditable; m_isVarietyEditable = varietyEditable;
} }
void MItem::setShapeEditable(bool shapeEditable) void MItem::setShapeEditable(bool shapeEditable)
{ {
m_shapeEditable = shapeEditable; m_isShapeEditable = shapeEditable;
} }
void MItem::accept(MVisitor *visitor) void MItem::accept(MVisitor *visitor)

View File

@@ -51,11 +51,11 @@ public:
void setVariety(const QString &variety); void setVariety(const QString &variety);
bool isVarietyEditable() const { return m_varietyEditable; } bool isVarietyEditable() const { return m_isVarietyEditable; }
void setVarietyEditable(bool varietyEditable); void setVarietyEditable(bool varietyEditable);
bool isShapeEditable() const { return m_shapeEditable; } bool isShapeEditable() const { return m_isShapeEditable; }
void setShapeEditable(bool shapeEditable); void setShapeEditable(bool shapeEditable);
@@ -69,9 +69,9 @@ private:
QString m_variety; QString m_variety;
bool m_varietyEditable; bool m_isVarietyEditable;
bool m_shapeEditable; bool m_isShapeEditable;
}; };

View File

@@ -36,14 +36,14 @@ namespace qmt {
MSourceExpansion::MSourceExpansion() MSourceExpansion::MSourceExpansion()
: MExpansion(), : MExpansion(),
m_transient(false) m_isTransient(false)
{ {
} }
MSourceExpansion::MSourceExpansion(const MSourceExpansion &rhs) MSourceExpansion::MSourceExpansion(const MSourceExpansion &rhs)
: MExpansion(rhs), : MExpansion(rhs),
m_sourceId(rhs.m_sourceId), m_sourceId(rhs.m_sourceId),
m_transient(rhs.m_transient) m_isTransient(rhs.m_isTransient)
{ {
} }
@@ -55,7 +55,7 @@ MSourceExpansion &MSourceExpansion::operator=(const MSourceExpansion &rhs)
{ {
if (this != &rhs) { if (this != &rhs) {
m_sourceId = rhs.m_sourceId; m_sourceId = rhs.m_sourceId;
m_transient = rhs.m_transient; m_isTransient = rhs.m_isTransient;
} }
return *this; return *this;
} }
@@ -75,7 +75,7 @@ void MSourceExpansion::setSourceId(const QString &sourceId)
void MSourceExpansion::setTransient(bool transient) void MSourceExpansion::setTransient(bool transient)
{ {
m_transient = transient; m_isTransient = transient;
} }
} }

View File

@@ -58,7 +58,7 @@ public:
void setSourceId(const QString &sourceId); void setSourceId(const QString &sourceId);
bool isTransient() const { return m_transient; } bool isTransient() const { return m_isTransient; }
void setTransient(bool transient); void setTransient(bool transient);
@@ -66,7 +66,7 @@ private:
QString m_sourceId; QString m_sourceId;
bool m_transient; bool m_isTransient;
}; };
} }

View File

@@ -644,7 +644,7 @@ ModelController::ModelController(QObject *parent)
: QObject(parent), : QObject(parent),
m_rootPackage(0), m_rootPackage(0),
m_undoController(0), m_undoController(0),
m_resettingModel(false) m_isResettingModel(false)
{ {
} }
@@ -689,21 +689,21 @@ MElement *ModelController::findElement(const Uid &key)
void ModelController::startResetModel() void ModelController::startResetModel()
{ {
QMT_CHECK(!m_resettingModel); QMT_CHECK(!m_isResettingModel);
m_resettingModel = true; m_isResettingModel = true;
emit beginResetModel(); emit beginResetModel();
QMT_CHECK(m_resettingModel); QMT_CHECK(m_isResettingModel);
} }
void ModelController::finishResetModel(bool modified) void ModelController::finishResetModel(bool modified)
{ {
QMT_CHECK(m_resettingModel); QMT_CHECK(m_isResettingModel);
emit endResetModel(); emit endResetModel();
if (modified) { if (modified) {
emit this->modified(); emit this->modified();
} }
QMT_CHECK(m_resettingModel); QMT_CHECK(m_isResettingModel);
m_resettingModel = false; m_isResettingModel = false;
} }
MObject *ModelController::object(int row, const MObject *owner) const MObject *ModelController::object(int row, const MObject *owner) const
@@ -726,7 +726,7 @@ void ModelController::addObject(MPackage *parentPackage, MObject *object)
QMT_CHECK(parentPackage); QMT_CHECK(parentPackage);
QMT_CHECK(object); QMT_CHECK(object);
int row = parentPackage->children().size(); int row = parentPackage->children().size();
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginInsertObject(row, parentPackage); emit beginInsertObject(row, parentPackage);
} }
mapObject(object); mapObject(object);
@@ -736,7 +736,7 @@ void ModelController::addObject(MPackage *parentPackage, MObject *object)
undoCommand->add(TypeObject, object->uid(), parentPackage->uid()); undoCommand->add(TypeObject, object->uid(), parentPackage->uid());
} }
parentPackage->addChild(object); parentPackage->addChild(object);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endInsertObject(row, parentPackage); emit endInsertObject(row, parentPackage);
emit modified(); emit modified();
} }
@@ -754,7 +754,7 @@ void ModelController::removeObject(MObject *object)
QMT_CHECK(object->owner()); QMT_CHECK(object->owner());
int row = object->owner()->children().indexOf(object); int row = object->owner()->children().indexOf(object);
MObject *owner = object->owner(); MObject *owner = object->owner();
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginRemoveObject(row, owner); emit beginRemoveObject(row, owner);
} }
if (m_undoController) { if (m_undoController) {
@@ -764,7 +764,7 @@ void ModelController::removeObject(MObject *object)
} }
unmapObject(object); unmapObject(object);
owner->removeChild(object); owner->removeChild(object);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endRemoveObject(row, owner); emit endRemoveObject(row, owner);
emit modified(); emit modified();
} }
@@ -787,7 +787,7 @@ void ModelController::startUpdateObject(MObject *object)
if (MPackage *package = dynamic_cast<MPackage *>(object)) { if (MPackage *package = dynamic_cast<MPackage *>(object)) {
m_oldPackageName = package->name(); m_oldPackageName = package->name();
} }
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginUpdateObject(row, parent); emit beginUpdateObject(row, parent);
} }
if (m_undoController) { if (m_undoController) {
@@ -806,7 +806,7 @@ void ModelController::finishUpdateObject(MObject *object, bool cancelled)
} else { } else {
row = parent->children().indexOf(object); row = parent->children().indexOf(object);
} }
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endUpdateObject(row, parent); emit endUpdateObject(row, parent);
if (!cancelled) { if (!cancelled) {
QList<MRelation *> relations = findRelationsOfObject(object); QList<MRelation *> relations = findRelationsOfObject(object);
@@ -835,7 +835,7 @@ void ModelController::moveObject(MPackage *newOwner, MObject *object)
MObject *formerOwner = object->owner(); MObject *formerOwner = object->owner();
QMT_CHECK(formerOwner); QMT_CHECK(formerOwner);
formerRow = formerOwner->children().indexOf(object); formerRow = formerOwner->children().indexOf(object);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginMoveObject(formerRow, formerOwner); emit beginMoveObject(formerRow, formerOwner);
} }
if (m_undoController) { if (m_undoController) {
@@ -845,7 +845,7 @@ void ModelController::moveObject(MPackage *newOwner, MObject *object)
formerOwner->decontrolChild(object); formerOwner->decontrolChild(object);
newOwner->addChild(object); newOwner->addChild(object);
int row = newOwner->children().indexOf(object); int row = newOwner->children().indexOf(object);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endMoveObject(row, newOwner); emit endMoveObject(row, newOwner);
emit modified(); emit modified();
} }
@@ -866,7 +866,7 @@ void ModelController::addRelation(MObject *owner, MRelation *relation)
QMT_CHECK(findObject(relation->endBUid())); QMT_CHECK(findObject(relation->endBUid()));
int row = owner->relations().size(); int row = owner->relations().size();
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginInsertRelation(row, owner); emit beginInsertRelation(row, owner);
} }
mapRelation(relation); mapRelation(relation);
@@ -876,7 +876,7 @@ void ModelController::addRelation(MObject *owner, MRelation *relation)
undoCommand->add(TypeRelation, relation->uid(), owner->uid()); undoCommand->add(TypeRelation, relation->uid(), owner->uid());
} }
owner->addRelation(relation); owner->addRelation(relation);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endInsertRelation(row, owner); emit endInsertRelation(row, owner);
emit modified(); emit modified();
} }
@@ -889,7 +889,7 @@ void ModelController::removeRelation(MRelation *relation)
MObject *owner = relation->owner(); MObject *owner = relation->owner();
QMT_CHECK(owner); QMT_CHECK(owner);
int row = owner->relations().indexOf(relation); int row = owner->relations().indexOf(relation);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginRemoveRelation(row, owner); emit beginRemoveRelation(row, owner);
} }
if (m_undoController) { if (m_undoController) {
@@ -899,7 +899,7 @@ void ModelController::removeRelation(MRelation *relation)
} }
unmapRelation(relation); unmapRelation(relation);
owner->removeRelation(relation); owner->removeRelation(relation);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endRemoveRelation(row, owner); emit endRemoveRelation(row, owner);
emit modified(); emit modified();
} }
@@ -911,7 +911,7 @@ void ModelController::startUpdateRelation(MRelation *relation)
QMT_CHECK(relation); QMT_CHECK(relation);
MObject *owner = relation->owner(); MObject *owner = relation->owner();
QMT_CHECK(owner); QMT_CHECK(owner);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginUpdateRelation(owner->relations().indexOf(relation), owner); emit beginUpdateRelation(owner->relations().indexOf(relation), owner);
} }
if (m_undoController) { if (m_undoController) {
@@ -926,7 +926,7 @@ void ModelController::finishUpdateRelation(MRelation *relation, bool cancelled)
QMT_CHECK(findObject(relation->endBUid())); QMT_CHECK(findObject(relation->endBUid()));
MObject *owner = relation->owner(); MObject *owner = relation->owner();
QMT_CHECK(owner); QMT_CHECK(owner);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endUpdateRelation(owner->relations().indexOf(relation), owner); emit endUpdateRelation(owner->relations().indexOf(relation), owner);
if (!cancelled) { if (!cancelled) {
emit modified(); emit modified();
@@ -945,7 +945,7 @@ void ModelController::moveRelation(MObject *newOwner, MRelation *relation)
MObject *formerOwner = relation->owner(); MObject *formerOwner = relation->owner();
QMT_CHECK(formerOwner); QMT_CHECK(formerOwner);
formerRow = formerOwner->relations().indexOf(relation); formerRow = formerOwner->relations().indexOf(relation);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit beginMoveRelation(formerRow, formerOwner); emit beginMoveRelation(formerRow, formerOwner);
} }
if (m_undoController) { if (m_undoController) {
@@ -955,7 +955,7 @@ void ModelController::moveRelation(MObject *newOwner, MRelation *relation)
formerOwner->decontrolRelation(relation); formerOwner->decontrolRelation(relation);
newOwner->addRelation(relation); newOwner->addRelation(relation);
int row = newOwner->relations().indexOf(relation); int row = newOwner->relations().indexOf(relation);
if (!m_resettingModel) { if (!m_isResettingModel) {
emit endMoveRelation(row, newOwner); emit endMoveRelation(row, newOwner);
emit modified(); emit modified();
} }

View File

@@ -247,7 +247,7 @@ private:
QMultiHash<Uid, MRelation *> m_objectRelationsMap; QMultiHash<Uid, MRelation *> m_objectRelationsMap;
bool m_resettingModel; bool m_isResettingModel;
QString m_oldPackageName; QString m_oldPackageName;

View File

@@ -45,7 +45,7 @@ public:
public: public:
bool isValid() const { return m_valid; } bool isValid() const { return m_isValid; }
bool atEnd() const { return m_pos == m_text.length(); } bool atEnd() const { return m_pos == m_text.length(); }
@@ -87,7 +87,7 @@ private:
QString m_text; QString m_text;
bool m_valid; bool m_isValid;
int m_pos; int m_pos;
@@ -97,7 +97,7 @@ private:
ClassMembersEdit::Cursor::Cursor(const QString &text) ClassMembersEdit::Cursor::Cursor(const QString &text)
: m_text(preparse(text)), : m_text(preparse(text)),
m_valid(true), m_isValid(true),
m_pos(0), m_pos(0),
m_lastPos(-1) m_lastPos(-1)
{ {
@@ -105,7 +105,7 @@ ClassMembersEdit::Cursor::Cursor(const QString &text)
void ClassMembersEdit::Cursor::setPosition(int pos) void ClassMembersEdit::Cursor::setPosition(int pos)
{ {
if (m_valid) { if (m_isValid) {
m_pos = pos; m_pos = pos;
} }
} }
@@ -114,13 +114,13 @@ QString ClassMembersEdit::Cursor::readWord()
{ {
skipWhitespaces(); skipWhitespaces();
QString word; QString word;
if (m_valid && m_pos < m_text.length()) { if (m_isValid && m_pos < m_text.length()) {
m_lastPos = m_pos; m_lastPos = m_pos;
QChar c = m_text.at(m_pos); QChar c = m_text.at(m_pos);
++m_pos; ++m_pos;
if (c.isLetterOrNumber() ||c == QLatin1Char('_')) { if (c.isLetterOrNumber() ||c == QLatin1Char('_')) {
word = c; word = c;
while (m_valid && m_pos < m_text.length() && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) { while (m_isValid && m_pos < m_text.length() && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) {
word += m_text.at(m_pos); word += m_text.at(m_pos);
++m_pos; ++m_pos;
} }
@@ -136,7 +136,7 @@ QString ClassMembersEdit::Cursor::readWord()
} }
} }
} else { } else {
m_valid = false; m_isValid = false;
} }
return word; return word;
} }
@@ -144,7 +144,7 @@ QString ClassMembersEdit::Cursor::readWord()
bool ClassMembersEdit::Cursor::skip(const QString &s) bool ClassMembersEdit::Cursor::skip(const QString &s)
{ {
skipWhitespaces(); skipWhitespaces();
if (m_valid && m_pos + s.length() <= m_text.length() && s.compare(m_text.mid(m_pos, s.length()), s, Qt::CaseInsensitive) == 0) { if (m_isValid && m_pos + s.length() <= m_text.length() && s.compare(m_text.mid(m_pos, s.length()), s, Qt::CaseInsensitive) == 0) {
m_pos += s.length(); m_pos += s.length();
return true; return true;
} }
@@ -154,9 +154,9 @@ bool ClassMembersEdit::Cursor::skip(const QString &s)
QString ClassMembersEdit::Cursor::readUntil(const QString &delimiter) QString ClassMembersEdit::Cursor::readUntil(const QString &delimiter)
{ {
QString s; QString s;
while (m_valid) { while (m_isValid) {
if (m_pos >= m_text.length() || m_text.at(m_pos) == QStringLiteral("\n")) { if (m_pos >= m_text.length() || m_text.at(m_pos) == QStringLiteral("\n")) {
m_valid = false; m_isValid = false;
return s; return s;
} }
if (m_pos + delimiter.length() <= m_text.length() && s.compare(m_text.mid(m_pos, delimiter.length()), delimiter, Qt::CaseInsensitive) == 0) { if (m_pos + delimiter.length() <= m_text.length() && s.compare(m_text.mid(m_pos, delimiter.length()), delimiter, Qt::CaseInsensitive) == 0) {
@@ -171,11 +171,11 @@ QString ClassMembersEdit::Cursor::readUntil(const QString &delimiter)
void ClassMembersEdit::Cursor::unreadWord() void ClassMembersEdit::Cursor::unreadWord()
{ {
if (!m_valid) { if (!m_isValid) {
return; return;
} }
if (m_lastPos < 0) { if (m_lastPos < 0) {
m_valid = false; m_isValid = false;
return; return;
} }
m_pos = m_lastPos; m_pos = m_lastPos;
@@ -183,7 +183,7 @@ void ClassMembersEdit::Cursor::unreadWord()
void ClassMembersEdit::Cursor::skipUntilOrNewline(const QString &delimiter) void ClassMembersEdit::Cursor::skipUntilOrNewline(const QString &delimiter)
{ {
while (m_valid) { while (m_isValid) {
if (m_pos >= m_text.length()) { if (m_pos >= m_text.length()) {
return; return;
} }
@@ -202,13 +202,13 @@ QString ClassMembersEdit::Cursor::readWordFromRight()
{ {
skipWhitespacesFromRight(); skipWhitespacesFromRight();
QString word; QString word;
if (m_valid && m_pos >= 0) { if (m_isValid && m_pos >= 0) {
m_lastPos = m_pos; m_lastPos = m_pos;
QChar c = m_text.at(m_pos); QChar c = m_text.at(m_pos);
--m_pos; --m_pos;
if (c.isLetterOrNumber() || c == QLatin1Char('_')) { if (c.isLetterOrNumber() || c == QLatin1Char('_')) {
word = c; word = c;
while (m_valid && m_pos >= 0 && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) { while (m_isValid && m_pos >= 0 && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) {
word = m_text.at(m_pos) + word; word = m_text.at(m_pos) + word;
--m_pos; --m_pos;
} }
@@ -224,7 +224,7 @@ QString ClassMembersEdit::Cursor::readWordFromRight()
} }
} }
} else { } else {
m_valid = false; m_isValid = false;
} }
return word; return word;
@@ -233,7 +233,7 @@ QString ClassMembersEdit::Cursor::readWordFromRight()
bool ClassMembersEdit::Cursor::skipFromRight(const QString &s) bool ClassMembersEdit::Cursor::skipFromRight(const QString &s)
{ {
skipWhitespacesFromRight(); skipWhitespacesFromRight();
if (m_valid && m_pos - s.length() >= 0 if (m_isValid && m_pos - s.length() >= 0
&& s.compare(m_text.mid(m_pos - s.length() + 1, s.length()), s, Qt::CaseInsensitive) == 0) { && s.compare(m_text.mid(m_pos - s.length() + 1, s.length()), s, Qt::CaseInsensitive) == 0) {
m_pos -= s.length(); m_pos -= s.length();
return true; return true;
@@ -243,30 +243,30 @@ bool ClassMembersEdit::Cursor::skipFromRight(const QString &s)
QString ClassMembersEdit::Cursor::extractSubstr(int start, int stop) QString ClassMembersEdit::Cursor::extractSubstr(int start, int stop)
{ {
if (m_valid && start >= 0 && start < m_text.length() && stop >= start && stop < m_text.length()) { if (m_isValid && start >= 0 && start < m_text.length() && stop >= start && stop < m_text.length()) {
return m_text.mid(start, stop - start + 1); return m_text.mid(start, stop - start + 1);
} }
m_valid = false; m_isValid = false;
return QStringLiteral(""); return QStringLiteral("");
} }
void ClassMembersEdit::Cursor::skipWhitespaces() void ClassMembersEdit::Cursor::skipWhitespaces()
{ {
while (m_valid && m_pos < m_text.length() && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) { while (m_isValid && m_pos < m_text.length() && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) {
++m_pos; ++m_pos;
} }
if (m_pos >= m_text.length()) { if (m_pos >= m_text.length()) {
m_valid = false; m_isValid = false;
} }
} }
void ClassMembersEdit::Cursor::skipWhitespacesFromRight() void ClassMembersEdit::Cursor::skipWhitespacesFromRight()
{ {
while (m_valid && m_pos >= 0 && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) { while (m_isValid && m_pos >= 0 && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) {
--m_pos; --m_pos;
} }
if (m_pos < 0) { if (m_pos < 0) {
m_valid = false; m_isValid = false;
} }
} }
@@ -305,11 +305,11 @@ class ClassMembersEdit::ClassMembersEditPrivate
{ {
public: public:
ClassMembersEditPrivate() ClassMembersEditPrivate()
: m_valid(true) : m_isValid(true)
{ {
} }
bool m_valid; bool m_isValid;
QList<MClassMember> m_members; QList<MClassMember> m_members;
}; };
@@ -342,9 +342,9 @@ void ClassMembersEdit::reparse()
{ {
bool ok = false; bool ok = false;
QList<MClassMember> members = parse(toPlainText(), &ok); QList<MClassMember> members = parse(toPlainText(), &ok);
if (ok != d->m_valid) { if (ok != d->m_isValid) {
d->m_valid = ok; d->m_isValid = ok;
emit statusChanged(d->m_valid); emit statusChanged(d->m_isValid);
} }
if (ok) { if (ok) {
if (members != d->m_members) { if (members != d->m_members) {
@@ -359,9 +359,9 @@ void ClassMembersEdit::onTextChanged()
{ {
bool ok = false; bool ok = false;
QList<MClassMember> members = parse(toPlainText(), &ok); QList<MClassMember> members = parse(toPlainText(), &ok);
if (ok != d->m_valid) { if (ok != d->m_isValid) {
d->m_valid = ok; d->m_isValid = ok;
emit statusChanged(d->m_valid); emit statusChanged(d->m_isValid);
} }
if (ok) { if (ok) {
if (members != d->m_members) { if (members != d->m_members) {

View File

@@ -840,7 +840,7 @@ void PropertiesView::MView::visitDObject(const DObject *object)
} }
if (!m_autoSizedCheckbox->hasFocus()) { if (!m_autoSizedCheckbox->hasFocus()) {
bool autoSized; bool autoSized;
if (haveSameValue(m_diagramElements, &DObject::hasAutoSize, &autoSized)) { if (haveSameValue(m_diagramElements, &DObject::isAutoSized, &autoSized)) {
m_autoSizedCheckbox->setChecked(autoSized); m_autoSizedCheckbox->setChecked(autoSized);
} else { } else {
m_autoSizedCheckbox->setChecked(false); m_autoSizedCheckbox->setChecked(false);
@@ -984,7 +984,7 @@ void PropertiesView::MView::visitDComponent(const DComponent *component)
} }
if (!m_plainShapeCheckbox->hasFocus()) { if (!m_plainShapeCheckbox->hasFocus()) {
bool plainShape; bool plainShape;
if (haveSameValue(m_diagramElements, &DComponent::plainShape, &plainShape)) { if (haveSameValue(m_diagramElements, &DComponent::isPlainShape, &plainShape)) {
m_plainShapeCheckbox->setChecked(plainShape); m_plainShapeCheckbox->setChecked(plainShape);
} else { } else {
m_plainShapeCheckbox->setChecked(false); m_plainShapeCheckbox->setChecked(false);
@@ -1060,7 +1060,7 @@ void PropertiesView::MView::visitDAnnotation(const DAnnotation *annotation)
} }
if (!m_annotationAutoWidthCheckbox->hasFocus()) { if (!m_annotationAutoWidthCheckbox->hasFocus()) {
bool autoSized; bool autoSized;
if (haveSameValue(m_diagramElements, &DAnnotation::hasAutoSize, &autoSized)) { if (haveSameValue(m_diagramElements, &DAnnotation::isAutoSized, &autoSized)) {
m_annotationAutoWidthCheckbox->setChecked(autoSized); m_annotationAutoWidthCheckbox->setChecked(autoSized);
} else { } else {
m_annotationAutoWidthCheckbox->setChecked(false); m_annotationAutoWidthCheckbox->setChecked(false);
@@ -1189,7 +1189,7 @@ void PropertiesView::MView::onAssociationEndBKindChanged(int kindIndex)
void PropertiesView::MView::onAutoSizedChanged(bool autoSized) void PropertiesView::MView::onAutoSizedChanged(bool autoSized)
{ {
assignModelElement<DObject, bool>(m_diagramElements, SelectionMulti, autoSized, &DObject::hasAutoSize, &DObject::setAutoSize); assignModelElement<DObject, bool>(m_diagramElements, SelectionMulti, autoSized, &DObject::isAutoSized, &DObject::setAutoSized);
} }
void PropertiesView::MView::onVisualPrimaryRoleChanged(int visualRoleIndex) void PropertiesView::MView::onVisualPrimaryRoleChanged(int visualRoleIndex)
@@ -1228,7 +1228,7 @@ void PropertiesView::MView::onShowAllMembersChanged(bool showAllMembers)
void PropertiesView::MView::onPlainShapeChanged(bool plainShape) void PropertiesView::MView::onPlainShapeChanged(bool plainShape)
{ {
assignModelElement<DComponent, bool>(m_diagramElements, SelectionMulti, plainShape, &DComponent::plainShape, &DComponent::setPlainShape); assignModelElement<DComponent, bool>(m_diagramElements, SelectionMulti, plainShape, &DComponent::isPlainShape, &DComponent::setPlainShape);
} }
void PropertiesView::MView::onItemShapeChanged(const QString &shape) void PropertiesView::MView::onItemShapeChanged(const QString &shape)
@@ -1238,7 +1238,7 @@ void PropertiesView::MView::onItemShapeChanged(const QString &shape)
void PropertiesView::MView::onAutoWidthChanged(bool autoWidthed) void PropertiesView::MView::onAutoWidthChanged(bool autoWidthed)
{ {
assignModelElement<DAnnotation, bool>(m_diagramElements, SelectionMulti, autoWidthed, &DAnnotation::hasAutoSize, &DAnnotation::setAutoSize); assignModelElement<DAnnotation, bool>(m_diagramElements, SelectionMulti, autoWidthed, &DAnnotation::isAutoSized, &DAnnotation::setAutoSized);
} }
void PropertiesView::MView::onAnnotationVisualRoleChanged(int visualRoleIndex) void PropertiesView::MView::onAnnotationVisualRoleChanged(int visualRoleIndex)

View File

@@ -126,7 +126,7 @@ inline void Access<Archive, DObject>::serialize(Archive &archive, DObject &objec
|| attr(QStringLiteral("name"), object, &DObject::name, &DObject::setName) || attr(QStringLiteral("name"), object, &DObject::name, &DObject::setName)
|| attr(QStringLiteral("pos"), object, &DObject::pos, &DObject::setPos) || attr(QStringLiteral("pos"), object, &DObject::pos, &DObject::setPos)
|| attr(QStringLiteral("rect"), object, &DObject::rect, &DObject::setRect) || attr(QStringLiteral("rect"), object, &DObject::rect, &DObject::setRect)
|| attr(QStringLiteral("auto-sized"), object, &DObject::hasAutoSize, &DObject::setAutoSize) || attr(QStringLiteral("auto-sized"), object, &DObject::isAutoSized, &DObject::setAutoSized)
|| attr(QStringLiteral("visual-role"), object, &visualRole, &setVisualRole) || attr(QStringLiteral("visual-role"), object, &visualRole, &setVisualRole)
|| attr(QStringLiteral("visual-role2"), object, &DObject::visualSecondaryRole, &DObject::setVisualSecondaryRole) || attr(QStringLiteral("visual-role2"), object, &DObject::visualSecondaryRole, &DObject::setVisualSecondaryRole)
|| attr(QStringLiteral("visual-emphasized"), object, &DObject::isVisualEmphasized, &DObject::setVisualEmphasized) || attr(QStringLiteral("visual-emphasized"), object, &DObject::isVisualEmphasized, &DObject::setVisualEmphasized)
@@ -191,7 +191,7 @@ inline void Access<Archive, DComponent>::serialize(Archive &archive, DComponent
{ {
archive || tag(component) archive || tag(component)
|| base<DObject>(component) || base<DObject>(component)
|| attr(QStringLiteral("plain-shape"), component, &DComponent::plainShape, &DComponent::setPlainShape) || attr(QStringLiteral("plain-shape"), component, &DComponent::isPlainShape, &DComponent::setPlainShape)
|| end; || end;
} }
@@ -362,7 +362,7 @@ inline void Access<Archive, DAnnotation>::serialize(Archive &archive, DAnnotatio
|| attr(QStringLiteral("text"), annotation, &DAnnotation::text, &DAnnotation::setText) || attr(QStringLiteral("text"), annotation, &DAnnotation::text, &DAnnotation::setText)
|| attr(QStringLiteral("pos"), annotation, &DAnnotation::pos, &DAnnotation::setPos) || attr(QStringLiteral("pos"), annotation, &DAnnotation::pos, &DAnnotation::setPos)
|| attr(QStringLiteral("rect"), annotation, &DAnnotation::rect, &DAnnotation::setRect) || attr(QStringLiteral("rect"), annotation, &DAnnotation::rect, &DAnnotation::setRect)
|| attr(QStringLiteral("auto-sized"), annotation, &DAnnotation::hasAutoSize, &DAnnotation::setAutoSize) || attr(QStringLiteral("auto-sized"), annotation, &DAnnotation::isAutoSized, &DAnnotation::setAutoSized)
|| attr(QStringLiteral("visual-role"), annotation, &DAnnotation::visualRole, &DAnnotation::setVisualRole) || attr(QStringLiteral("visual-role"), annotation, &DAnnotation::visualRole, &DAnnotation::setVisualRole)
|| end; || end;
} }

View File

@@ -37,7 +37,7 @@ namespace qmt {
ObjectVisuals::ObjectVisuals() ObjectVisuals::ObjectVisuals()
: m_visualPrimaryRole(DObject::PrimaryRoleNormal), : m_visualPrimaryRole(DObject::PrimaryRoleNormal),
m_visualSecondaryRole(DObject::SecondaryRoleNone), m_visualSecondaryRole(DObject::SecondaryRoleNone),
m_emphasized(false), m_isEmphasized(false),
m_depth(0) m_depth(0)
{ {
} }
@@ -47,7 +47,7 @@ ObjectVisuals::ObjectVisuals(DObject::VisualPrimaryRole visualPrimaryRole,
bool emphasized, const QColor &baseColor, int depth) bool emphasized, const QColor &baseColor, int depth)
: m_visualPrimaryRole(visualPrimaryRole), : m_visualPrimaryRole(visualPrimaryRole),
m_visualSecondaryRole(visualSecondaryRole), m_visualSecondaryRole(visualSecondaryRole),
m_emphasized(emphasized), m_isEmphasized(emphasized),
m_baseColor(baseColor), m_baseColor(baseColor),
m_depth(depth) m_depth(depth)
{ {
@@ -69,7 +69,7 @@ void ObjectVisuals::setVisualSecondaryRole(DObject::VisualSecondaryRole visualSe
void ObjectVisuals::setEmphasized(bool emphasized) void ObjectVisuals::setEmphasized(bool emphasized)
{ {
m_emphasized = emphasized; m_isEmphasized = emphasized;
} }
void ObjectVisuals::setBaseColor(const QColor &baseColor) void ObjectVisuals::setBaseColor(const QColor &baseColor)

View File

@@ -56,7 +56,7 @@ public:
void setVisualSecondaryRole(DObject::VisualSecondaryRole visualSecondaryRole); void setVisualSecondaryRole(DObject::VisualSecondaryRole visualSecondaryRole);
bool isEmphasized() const { return m_emphasized; } bool isEmphasized() const { return m_isEmphasized; }
void setEmphasized(bool emphasized); void setEmphasized(bool emphasized);
@@ -74,7 +74,7 @@ private:
DObject::VisualSecondaryRole m_visualSecondaryRole; DObject::VisualSecondaryRole m_visualSecondaryRole;
bool m_emphasized; bool m_isEmphasized;
QColor m_baseColor; QColor m_baseColor;

View File

@@ -547,7 +547,7 @@ void DiagramSceneController::alignSize(DObject *object, const DSelection &select
QRectF newRect = aligner(selectedObject, size); QRectF newRect = aligner(selectedObject, size);
if (newRect != selectedObject->rect()) { if (newRect != selectedObject->rect()) {
m_diagramController->startUpdateElement(selectedObject, diagram, DiagramController::UpdateGeometry); m_diagramController->startUpdateElement(selectedObject, diagram, DiagramController::UpdateGeometry);
selectedObject->setAutoSize(false); selectedObject->setAutoSized(false);
selectedObject->setRect(newRect); selectedObject->setRect(newRect);
m_diagramController->finishUpdateElement(selectedObject, diagram, false); m_diagramController->finishUpdateElement(selectedObject, diagram, false);
} }

View File

@@ -55,7 +55,7 @@ QStringParser::Parser QStringParser::parse(const QString &pattern)
QStringParser::Parser::Parser(const QString &source, const QString &pattern) QStringParser::Parser::Parser(const QString &source, const QString &pattern)
: m_source(source), : m_source(source),
m_pattern(pattern), m_pattern(pattern),
m_evaluated(false), m_isEvaluated(false),
m_evaluationFailed(false) m_evaluationFailed(false)
{ {
} }
@@ -151,8 +151,8 @@ bool QStringParser::Parser::scan(double *d, int *index)
void QStringParser::Parser::evaluate() void QStringParser::Parser::evaluate()
{ {
if (!m_evaluated) { if (!m_isEvaluated) {
m_evaluated = true; m_isEvaluated = true;
m_evaluationFailed = false; m_evaluationFailed = false;
int p = 0; int p = 0;

View File

@@ -143,7 +143,7 @@ private:
const QString m_source; const QString m_source;
const QString m_pattern; const QString m_pattern;
bool m_evaluated; bool m_isEvaluated;
bool m_evaluationFailed; bool m_evaluationFailed;
QList<Node *> m_nodes; QList<Node *> m_nodes;
}; };

View File

@@ -386,7 +386,7 @@ public:
Node *node = m_nodeStack.pop(); Node *node = m_nodeStack.pop();
if (m_nodeStack.empty()) { if (m_nodeStack.empty()) {
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (xmlTag.m_tagName != node->qualifiedName() || xmlTag.m_endTag) { if (xmlTag.m_tagName != node->qualifiedName() || xmlTag.m_isEndTag) {
throw FileFormatException(); throw FileFormatException();
} }
node->accept(*this, xmlTag); node->accept(*this, xmlTag);
@@ -543,7 +543,7 @@ public:
void readReferenceEndTag(ReferenceKind kind) void readReferenceEndTag(ReferenceKind kind)
{ {
XmlTag tag = readTag(); XmlTag tag = readTag();
if (!tag.m_endTag) { if (!tag.m_isEndTag) {
throw FileFormatException(); throw FileFormatException();
} else if (tag.m_tagName == QLatin1String("null") && kind != Nullpointer) { } else if (tag.m_tagName == QLatin1String("null") && kind != Nullpointer) {
throw FileFormatException(); throw FileFormatException();
@@ -573,9 +573,9 @@ private:
class XmlTag class XmlTag
{ {
public: public:
XmlTag() : m_endTag(false) { } XmlTag() : m_isEndTag(false) { }
QString m_tagName; QString m_tagName;
bool m_endTag; bool m_isEndTag;
impl::ObjectId m_id; impl::ObjectId m_id;
QHash<QString, QString> m_attributes; QHash<QString, QString> m_attributes;
}; };
@@ -583,7 +583,7 @@ private:
void readChildren(Node *node) { void readChildren(Node *node) {
for (;;) { for (;;) {
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (xmlTag.m_endTag) { if (xmlTag.m_isEndTag) {
if (xmlTag.m_tagName != node->qualifiedName()) { if (xmlTag.m_tagName != node->qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
@@ -627,7 +627,7 @@ private:
{ {
load(*this, node->base().base(), node->base().parameters()); load(*this, node->base().base(), node->base().parameters());
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->base().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->base().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -637,7 +637,7 @@ private:
{ {
load(*this, *node->attribute().value(), node->attribute().parameters()); load(*this, *node->attribute().value(), node->attribute().parameters());
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -649,7 +649,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().object().*(node->attribute().setter()))(value); (node->attribute().object().*(node->attribute().setter()))(value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -661,7 +661,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().object().*(node->attribute().setter()))(value); (node->attribute().object().*(node->attribute().setter()))(value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -673,7 +673,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().object().*(node->attribute().setter()))(value); (node->attribute().object().*(node->attribute().setter()))(value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -685,7 +685,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().object().*(node->attribute().setter()))(value); (node->attribute().object().*(node->attribute().setter()))(value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -697,7 +697,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().setterFunc())(node->attribute().object(), value); (node->attribute().setterFunc())(node->attribute().object(), value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -709,7 +709,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().setterFunc())(node->attribute().object(), value); (node->attribute().setterFunc())(node->attribute().object(), value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -721,7 +721,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().setterFunc())(node->attribute().object(), value); (node->attribute().setterFunc())(node->attribute().object(), value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -733,7 +733,7 @@ private:
load(*this, value, node->attribute().parameters()); load(*this, value, node->attribute().parameters());
(node->attribute().setterFunc())(node->attribute().object(), value); (node->attribute().setterFunc())(node->attribute().object(), value);
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -749,7 +749,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -765,7 +765,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -781,7 +781,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -797,7 +797,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -813,7 +813,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -829,7 +829,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -845,7 +845,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -861,7 +861,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -877,7 +877,7 @@ private:
m_currentRefNode = 0; m_currentRefNode = 0;
} }
XmlTag xmlTag = readTag(); XmlTag xmlTag = readTag();
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) { if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
throw FileFormatException(); throw FileFormatException();
} }
} }
@@ -906,7 +906,7 @@ QXmlInArchive::XmlTag QXmlInArchive::readTag()
throw FileFormatException(); throw FileFormatException();
} }
xmlTag.m_tagName = m_stream.name().toString(); xmlTag.m_tagName = m_stream.name().toString();
xmlTag.m_endTag = true; xmlTag.m_isEndTag = true;
m_endTagWasRead = false; m_endTagWasRead = false;
return xmlTag; return xmlTag;
} }
@@ -931,7 +931,7 @@ QXmlInArchive::XmlTag QXmlInArchive::readTag()
return xmlTag; return xmlTag;
case QXmlStreamReader::EndElement: case QXmlStreamReader::EndElement:
xmlTag.m_tagName = m_stream.name().toString(); xmlTag.m_tagName = m_stream.name().toString();
xmlTag.m_endTag = true; xmlTag.m_isEndTag = true;
return xmlTag; return xmlTag;
case QXmlStreamReader::Comment: case QXmlStreamReader::Comment:
// intentionally left blank // intentionally left blank

View File

@@ -66,7 +66,7 @@ public:
QXmlOutArchive(QXmlStreamWriter &stream) QXmlOutArchive(QXmlStreamWriter &stream)
: m_stream(stream), : m_stream(stream),
m_nextPointerIsReference(false) m_isNextPointerAReference(false)
{ {
} }
@@ -230,13 +230,13 @@ public:
void beginReference(const Ref<T> &ref) void beginReference(const Ref<T> &ref)
{ {
m_stream.writeStartElement(ref.qualifiedName()); m_stream.writeStartElement(ref.qualifiedName());
m_nextPointerIsReference = true; m_isNextPointerAReference = true;
} }
template<class T> template<class T>
void endReference(const Ref<T> &) void endReference(const Ref<T> &)
{ {
m_nextPointerIsReference = false; m_isNextPointerAReference = false;
m_stream.writeEndElement(); m_stream.writeEndElement();
} }
@@ -244,13 +244,13 @@ public:
void beginReference(const GetterRef<U, T> &ref) void beginReference(const GetterRef<U, T> &ref)
{ {
m_stream.writeStartElement(ref.qualifiedName()); m_stream.writeStartElement(ref.qualifiedName());
m_nextPointerIsReference = true; m_isNextPointerAReference = true;
} }
template<class U, typename T> template<class U, typename T>
void endReference(const GetterRef<U, T> &) void endReference(const GetterRef<U, T> &)
{ {
m_nextPointerIsReference = false; m_isNextPointerAReference = false;
m_stream.writeEndElement(); m_stream.writeEndElement();
} }
@@ -258,13 +258,13 @@ public:
void beginReference(const GetterSetterRef<U, T, V> &ref) void beginReference(const GetterSetterRef<U, T, V> &ref)
{ {
m_stream.writeStartElement(ref.qualifiedName()); m_stream.writeStartElement(ref.qualifiedName());
m_nextPointerIsReference = true; m_isNextPointerAReference = true;
} }
template<class U, typename T, typename V> template<class U, typename T, typename V>
void endReference(const GetterSetterRef<U, T, V> &) void endReference(const GetterSetterRef<U, T, V> &)
{ {
m_nextPointerIsReference = false; m_isNextPointerAReference = false;
m_stream.writeEndElement(); m_stream.writeEndElement();
} }
@@ -272,13 +272,13 @@ public:
void beginReference(const GetFuncRef<U, T> &ref) void beginReference(const GetFuncRef<U, T> &ref)
{ {
m_stream.writeStartElement(ref.qualifiedName()); m_stream.writeStartElement(ref.qualifiedName());
m_nextPointerIsReference = true; m_isNextPointerAReference = true;
} }
template<class U, typename T> template<class U, typename T>
void endReference(const GetFuncRef<U, T> &) void endReference(const GetFuncRef<U, T> &)
{ {
m_nextPointerIsReference = false; m_isNextPointerAReference = false;
m_stream.writeEndElement(); m_stream.writeEndElement();
} }
@@ -286,20 +286,20 @@ public:
void beginReference(const GetSetFuncRef<U, T, V> &ref) void beginReference(const GetSetFuncRef<U, T, V> &ref)
{ {
m_stream.writeStartElement(ref.qualifiedName()); m_stream.writeStartElement(ref.qualifiedName());
m_nextPointerIsReference = true; m_isNextPointerAReference = true;
} }
template<class U, typename T, typename V> template<class U, typename T, typename V>
void endReference(const GetSetFuncRef<U, T, V> &) void endReference(const GetSetFuncRef<U, T, V> &)
{ {
m_nextPointerIsReference = false; m_isNextPointerAReference = false;
m_stream.writeEndElement(); m_stream.writeEndElement();
} }
template<typename T> template<typename T>
bool isReference(T *p) bool isReference(T *p)
{ {
return m_nextPointerIsReference || m_savingRefMap.hasDefinedRef(p); return m_isNextPointerAReference || m_savingRefMap.hasDefinedRef(p);
} }
void beginNullPointer() void beginNullPointer()
@@ -341,7 +341,7 @@ public:
private: private:
QXmlStreamWriter &m_stream; QXmlStreamWriter &m_stream;
impl::SavingRefMap m_savingRefMap; impl::SavingRefMap m_savingRefMap;
bool m_nextPointerIsReference; bool m_isNextPointerAReference;
}; };
} }