Commit 5d3812af authored by Jochen Becher's avatar Jochen Becher

ModelEditor: Apply naming convention to getters

Change-Id: If9eaaf0dc54e26e4b7e2b8952efd951a9113f104
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent beac7dcb
......@@ -90,9 +90,9 @@ void ConfigController::readStereotypeDefinitions(const QString &path)
try {
parser.parse(&source);
} catch (StereotypeDefinitionParserError x) {
qDebug() << x.getErrorMsg() << "in line" << x.getSourcePos().getLineNumber();
qDebug() << x.errorMessage() << "in line" << x.sourcePos().lineNumber();
} catch (TextScannerError x) {
qDebug() << x.getErrorMsg() << "in line" << x.getSourcePos().getLineNumber();
qDebug() << x.errorMessage() << "in line" << x.sourcePos().lineNumber();
} catch (...) {
}
}
......
......@@ -47,13 +47,13 @@ public:
bool isValid() const { return m_sourceId >= 0 && m_lineNumber >= 0; }
int getSourceId() const { return m_sourceId; }
int sourceId() const { return m_sourceId; }
int getLineNumber() const { return m_lineNumber; }
int lineNumber() const { return m_lineNumber; }
bool hasColumnNumber() const { return m_columnNumber >= 0; }
int getColumnNumber() const { return m_columnNumber; }
int columnNumber() const { return m_columnNumber; }
private:
int m_sourceId;
......
......@@ -56,7 +56,7 @@ public:
public:
SourcePos getSourcePos() const { return m_sourcePos; }
SourcePos sourcePos() const { return m_sourcePos; }
private:
SourcePos m_sourcePos;
......
......@@ -49,7 +49,7 @@ public:
void setText(const QString &text);
int getSourceId() const { return m_sourceId; }
int sourceId() const { return m_sourceId; }
void setSourceId(int sourceId);
......
......@@ -115,7 +115,7 @@ void TextScanner::setSource(ITextSource *textSource)
d->m_source = textSource;
}
SourcePos TextScanner::getSourcePos() const
SourcePos TextScanner::sourcePos() const
{
return d->m_lastSourcePos;
}
......
......@@ -54,7 +54,7 @@ public:
public:
SourcePos getSourcePos() const { return m_sourcePos; }
SourcePos sourcePos() const { return m_sourcePos; }
private:
SourcePos m_sourcePos;
......@@ -82,7 +82,7 @@ public:
void setSource(ITextSource *textSource);
SourcePos getSourcePos() const;
SourcePos sourcePos() const;
public:
......
......@@ -62,19 +62,19 @@ public:
public:
Type getType() const { return m_type; }
Type type() const { return m_type; }
void setType(Type type);
int getSubtype() const { return m_subtype; }
int subtype() const { return m_subtype; }
void setSubtype(int subtype);
QString getText() const { return m_text; }
QString text() const { return m_text; }
void setText(const QString &text);
SourcePos getSourcePos() const { return m_sourcePos; }
SourcePos sourcePos() const { return m_sourcePos; }
void setSourcePos(const SourcePos &sourcePos);
......
......@@ -73,7 +73,7 @@ public:
int size() const { return m_elements.size(); }
QList<T *> getElements() const { return m_elements; }
QList<T *> elements() const { return m_elements; }
QList<T *> takeElements() const
{
......
......@@ -51,7 +51,7 @@ public:
int size() const { return m_elements.size(); }
QList<T *> getElements() const { return m_elements; }
QList<T *> elements() const { return m_elements; }
void setElements(const QList<T *> &elements) { m_elements = elements; }
......
......@@ -50,9 +50,9 @@ public:
{
}
Uid getElementKey() const { return m_elementKey; }
Uid elementKey() const { return m_elementKey; }
Uid getOwnerKey() const { return m_ownerKey; }
Uid ownerKey() const { return m_ownerKey; }
private:
......@@ -73,7 +73,7 @@ public:
bool isEmpty() const { return m_indices.isEmpty(); }
QList<Index> getIndices() const { return m_indices; }
QList<Index> indices() const { return m_indices; }
void setIndices(const QList<Index> &indices);
......
......@@ -59,7 +59,7 @@ signals:
public:
QUndoStack *getUndoStack() const { return m_undoStack; }
QUndoStack *undoStack() const { return m_undoStack; }
public slots:
......
......@@ -66,21 +66,21 @@ public:
public:
Uid getModelUid() const { return Uid::getInvalidUid(); }
Uid modelUid() const { return Uid::invalidUid(); }
QString getText() const { return m_text; }
QString text() const { return m_text; }
void setText(const QString &text);
QPointF getPos() const { return m_pos; }
QPointF pos() const { return m_pos; }
void setPos(const QPointF &pos);
QRectF getRect() const { return m_rect; }
QRectF rect() const { return m_rect; }
void setRect(const QRectF &rect);
VisualRole getVisualRole() const { return m_visualRole; }
VisualRole visualRole() const { return m_visualRole; }
void setVisualRole(VisualRole visualRole);
......
......@@ -71,9 +71,9 @@ bool operator==(const DAssociationEnd &lhs, const DAssociationEnd &rhs)
if (&lhs == &rhs) {
return true;
}
return lhs.getName() == rhs.getName()
&& lhs.getCardinality() == rhs.getCardinality()
&& lhs.getKind() == rhs.getKind()
return lhs.name() == rhs.name()
&& lhs.cardinality() == rhs.cardinality()
&& lhs.kind() == rhs.kind()
&& lhs.isNavigable() == rhs.isNavigable();
}
......@@ -85,7 +85,7 @@ bool operator!=(const DAssociationEnd &lhs, const DAssociationEnd &rhs)
DAssociation::DAssociation()
: m_associationClassUid(Uid::getInvalidUid())
: m_associationClassUid(Uid::invalidUid())
{
}
......@@ -93,12 +93,12 @@ DAssociation::~DAssociation()
{
}
void DAssociation::setA(const DAssociationEnd &endA)
void DAssociation::setEndA(const DAssociationEnd &endA)
{
m_endA = endA;
}
void DAssociation::setB(const DAssociationEnd &endB)
void DAssociation::setEndB(const DAssociationEnd &endB)
{
m_endB = endB;
}
......
......@@ -47,15 +47,15 @@ public:
public:
QString getName() const { return m_name; }
QString name() const { return m_name; }
void setName(const QString &name);
QString getCardinality() const { return m_cardinality; }
QString cardinality() const { return m_cardinality; }
void setCardinatlity(const QString &cardinality);
MAssociationEnd::Kind getKind() const { return m_kind; }
MAssociationEnd::Kind kind() const { return m_kind; }
void setKind(MAssociationEnd::Kind kind);
......@@ -90,15 +90,15 @@ public:
public:
DAssociationEnd getA() const { return m_endA; }
DAssociationEnd endA() const { return m_endA; }
void setA(const DAssociationEnd &endA);
void setEndA(const DAssociationEnd &endA);
DAssociationEnd getB() const { return m_endB; }
DAssociationEnd endB() const { return m_endB; }
void setB(const DAssociationEnd &endB);
void setEndB(const DAssociationEnd &endB);
Uid getAssoicationClassUid() const { return m_associationClassUid; }
Uid assoicationClassUid() const { return m_associationClassUid; }
void setAssociationClassUid(const Uid &uid);
......
......@@ -55,17 +55,17 @@ public:
public:
Uid getModelUid() const { return Uid::getInvalidUid(); }
Uid modelUid() const { return Uid::invalidUid(); }
QString getText() const { return m_text; }
QString text() const { return m_text; }
void setText(const QString &text);
QPointF getPos() const { return m_pos; }
QPointF pos() const { return m_pos; }
void setPos(const QPointF &pos);
QRectF getRect() const { return m_rect; }
QRectF rect() const { return m_rect; }
void setRect(const QRectF &rect);
......
......@@ -42,7 +42,7 @@ DClass::DClass()
{
}
void DClass::setNamespace(const QString &nameSpace)
void DClass::setNameSpace(const QString &nameSpace)
{
m_namespace = nameSpace;
}
......
......@@ -55,27 +55,27 @@ public:
public:
QString getNamespace() const { return m_namespace; }
QString nameSpace() const { return m_namespace; }
void setNamespace(const QString &nameSpace);
void setNameSpace(const QString &nameSpace);
QList<QString> getTemplateParameters() const { return m_templateParameters; }
QList<QString> templateParameters() const { return m_templateParameters; }
void setTemplateParameters(const QList<QString> &templateParameters);
QList<MClassMember> getMembers() const { return m_members; }
QList<MClassMember> members() const { return m_members; }
void setMembers(const QList<MClassMember> &members);
QSet<Uid> getVisibleMembers() const { return m_visibleMembers; }
QSet<Uid> visibleMembers() const { return m_visibleMembers; }
void setVisibleMembers(const QSet<Uid> &visibleMembers);
TemplateDisplay getTemplateDisplay() const { return m_templateDisplay; }
TemplateDisplay templateDisplay() const { return m_templateDisplay; }
void setTemplateDisplay(TemplateDisplay templateDisplay);
bool getShowAllMembers() const { return m_showAllMembers; }
bool showAllMembers() const { return m_showAllMembers; }
void setShowAllMembers(bool showAllMembers);
......
......@@ -44,7 +44,7 @@ public:
public:
bool getPlainShape() const { return m_plainShape; }
bool plainShape() const { return m_plainShape; }
void setPlainShape(bool planeShape);
......
......@@ -45,24 +45,24 @@ DDependency::~DDependency()
{
}
Uid DDependency::getSource() const
Uid DDependency::source() const
{
return m_direction == MDependency::B_TO_A ? getEndB() : getEndA();
return m_direction == MDependency::B_TO_A ? endBUid() : endAUid();
}
void DDependency::setSource(const Uid &source)
{
m_direction == MDependency::B_TO_A ? setEndB(source) : setEndA(source);
m_direction == MDependency::B_TO_A ? setEndBUid(source) : setEndAUid(source);
}
Uid DDependency::getTarget() const
Uid DDependency::target() const
{
return m_direction == MDependency::B_TO_A ? getEndA() : getEndB();
return m_direction == MDependency::B_TO_A ? endAUid() : endBUid();
}
void DDependency::setTarget(const Uid &target)
{
return m_direction == MDependency::B_TO_A ? setEndA(target) : setEndB(target);
return m_direction == MDependency::B_TO_A ? setEndAUid(target) : setEndBUid(target);
}
void DDependency::setDirection(MDependency::Direction direction)
......
......@@ -51,15 +51,15 @@ public:
public:
Uid getSource() const;
Uid source() const;
void setSource(const Uid &source);
Uid getTarget() const;
Uid target() const;
void setTarget(const Uid &target);
MDependency::Direction getDirection() const { return m_direction; }
MDependency::Direction direction() const { return m_direction; }
void setDirection(MDependency::Direction direction);
......
......@@ -50,13 +50,13 @@ public:
virtual ~DElement();
public:
Uid getUid() const { return m_uid; }
Uid uid() const { return m_uid; }
void setUid(const Uid &uid);
void renewUid();
virtual Uid getModelUid() const = 0;
virtual Uid modelUid() const = 0;
public:
......
......@@ -42,24 +42,24 @@ DInheritance::DInheritance()
{
}
Uid DInheritance::getDerived() const
Uid DInheritance::derived() const
{
return getEndA();
return endAUid();
}
void DInheritance::setDerived(const Uid &derived)
{
setEndA(derived);
setEndAUid(derived);
}
Uid DInheritance::getBase() const
Uid DInheritance::base() const
{
return getEndB();
return endBUid();
}
void DInheritance::setBase(const Uid &base)
{
setEndB(base);
setEndBUid(base);
}
void DInheritance::accept(DVisitor *visitor)
......
......@@ -47,11 +47,11 @@ public:
public:
Uid getDerived() const;
Uid derived() const;
void setDerived(const Uid &derived);
Uid getBase() const;
Uid base() const;
void setBase(const Uid &base);
......
......@@ -47,11 +47,11 @@ public:
public:
QString getVariety() const { return m_variety; }
QString variety() const { return m_variety; }
void setVariety(const QString &variety);
QString getShape() const { return m_shape; }
QString shape() const { return m_shape; }
void setShape(const QString &shape);
......
......@@ -37,7 +37,7 @@ namespace qmt {
DObject::DObject()
: DElement(),
m_modelUid(Uid::getInvalidUid()),
m_modelUid(Uid::invalidUid()),
m_depth(0),
m_visualPrimaryRole(PRIMARY_ROLE_NORMAL),
m_visualSecondaryRole(SECONDARY_ROLE_NONE),
......
......@@ -92,43 +92,43 @@ public:
public:
Uid getModelUid() const { return m_modelUid; }
Uid modelUid() const { return m_modelUid; }
void setModelUid(const Uid &uid);
QList<QString> getStereotypes() const { return m_stereotypes; }
QList<QString> stereotypes() const { return m_stereotypes; }
void setStereotypes(const QList<QString> &stereotypes);
QString getContext() const { return m_context; }
QString context() const { return m_context; }
void setContext(const QString &context);
QString getName() const { return m_name; }
QString name() const { return m_name; }
void setName(const QString &name);
QPointF getPos() const { return m_pos; }
QPointF pos() const { return m_pos; }
void setPos(const QPointF &pos);
QRectF getRect() const { return m_rect; }
QRectF rect() const { return m_rect; }
void setRect(const QRectF &rect);
int getDepth() const { return m_depth; }
int depth() const { return m_depth; }
void setDepth(int depth);
VisualPrimaryRole getVisualPrimaryRole() const { return m_visualPrimaryRole; }
VisualPrimaryRole visualPrimaryRole() const { return m_visualPrimaryRole; }
void setVisualPrimaryRole(VisualPrimaryRole visualPrimaryRole);
VisualSecondaryRole getVisualSecondaryRole() const { return m_visualSecondaryRole; }
VisualSecondaryRole visualSecondaryRole() const { return m_visualSecondaryRole; }
void setVisualSecondaryRole(VisualSecondaryRole visualSecondaryRole);
StereotypeDisplay getStereotypeDisplay() const { return m_stereotypeDisplay; }
StereotypeDisplay stereotypeDisplay() const { return m_stereotypeDisplay; }
void setStereotypeDisplay(StereotypeDisplay stereotypeDisplay);
......
......@@ -48,15 +48,15 @@ void DRelation::IntermediatePoint::setPos(const QPointF &pos)
bool operator==(const DRelation::IntermediatePoint &lhs, const DRelation::IntermediatePoint &rhs)
{
return lhs.getPos() == rhs.getPos();
return lhs.pos() == rhs.pos();
}
DRelation::DRelation()
: DElement(),
m_modelUid(Uid::getInvalidUid()),
m_endAUid(Uid::getInvalidUid()),
m_endBUid(Uid::getInvalidUid())
m_modelUid(Uid::invalidUid()),
m_endAUid(Uid::invalidUid()),
m_endBUid(Uid::invalidUid())
{
}
......@@ -74,12 +74,12 @@ void DRelation::setStereotypes(const QList<QString> &stereotypes)
m_stereotypes = stereotypes;
}
void DRelation::setEndA(const Uid &uid)
void DRelation::setEndAUid(const Uid &uid)
{
m_endAUid = uid;
}
void DRelation::setEndB(const Uid &uid)
void DRelation::setEndBUid(const Uid &uid)
{
m_endBUid = uid;
}
......
......@@ -54,7 +54,7 @@ public:
explicit IntermediatePoint(const QPointF &pos = QPointF());
QPointF getPos() const { return m_pos; }
QPointF pos() const { return m_pos; }
void setPos(const QPointF &pos);
......@@ -69,27 +69,27 @@ public:
public:
Uid getModelUid() const { return m_modelUid; }
Uid modelUid() const { return m_modelUid; }
void setModelUid(const Uid &uid);
QList<QString> getStereotypes() const { return m_stereotypes; }
QList<QString> stereotypes() const { return m_stereotypes; }
void setStereotypes(const QList<QString> &stereotypes);
Uid getEndA() const { return m_endAUid; }
Uid endAUid() const { return m_endAUid; }