Commit 6add3313 authored by Jochen Becher's avatar Jochen Becher

ModelEditor: Apply naming convention to types

Use Pascal style for typedefs and class instead of struct.

Change-Id: Ib568994e70c8ac0a219b2fba1d998e04ef5f79da
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent d13b22e6
...@@ -45,8 +45,9 @@ ...@@ -45,8 +45,9 @@
namespace qmt { namespace qmt {
struct ConfigController::ConfigControllerPrivate class ConfigController::ConfigControllerPrivate
{ {
public:
ConfigControllerPrivate() ConfigControllerPrivate()
: m_stereotypeController(0) : m_stereotypeController(0)
{ {
......
...@@ -45,7 +45,7 @@ class QMT_EXPORT ConfigController : public QObject ...@@ -45,7 +45,7 @@ class QMT_EXPORT ConfigController : public QObject
{ {
Q_OBJECT Q_OBJECT
struct ConfigControllerPrivate; class ConfigControllerPrivate;
public: public:
......
...@@ -107,8 +107,9 @@ StereotypeDefinitionParserError::~StereotypeDefinitionParserError() ...@@ -107,8 +107,9 @@ StereotypeDefinitionParserError::~StereotypeDefinitionParserError()
} }
struct StereotypeDefinitionParser::StereotypeDefinitionParserPrivate class StereotypeDefinitionParser::StereotypeDefinitionParserPrivate
{ {
public:
StereotypeDefinitionParserPrivate() StereotypeDefinitionParserPrivate()
: m_scanner(0) : m_scanner(0)
{ {
...@@ -119,8 +120,9 @@ struct StereotypeDefinitionParser::StereotypeDefinitionParserPrivate ...@@ -119,8 +120,9 @@ struct StereotypeDefinitionParser::StereotypeDefinitionParserPrivate
}; };
struct StereotypeDefinitionParser::IconCommandParameter class StereotypeDefinitionParser::IconCommandParameter
{ {
public:
IconCommandParameter(ShapeValueF::Unit unit, ShapeValueF::Origin origin = ShapeValueF::OriginSmart) IconCommandParameter(ShapeValueF::Unit unit, ShapeValueF::Origin origin = ShapeValueF::OriginSmart)
: m_unit(unit), : m_unit(unit),
m_origin(origin) m_origin(origin)
......
...@@ -67,9 +67,9 @@ class QMT_EXPORT StereotypeDefinitionParser : public QObject ...@@ -67,9 +67,9 @@ class QMT_EXPORT StereotypeDefinitionParser : public QObject
{ {
Q_OBJECT Q_OBJECT
struct StereotypeDefinitionParserPrivate; class StereotypeDefinitionParserPrivate;
struct IconCommandParameter; class IconCommandParameter;
public: public:
......
...@@ -54,7 +54,9 @@ TextScannerError::~TextScannerError() ...@@ -54,7 +54,9 @@ TextScannerError::~TextScannerError()
{ {
} }
struct TextScanner::TextScannerPrivate { class TextScanner::TextScannerPrivate
{
public:
TextScannerPrivate() TextScannerPrivate()
: m_maxOperatorLength(0), : m_maxOperatorLength(0),
m_source(0) m_source(0)
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
namespace qmt { namespace qmt {
class ITextSource; class ITextSource;
struct SourceChar; class SourceChar;
class Token; class Token;
class QMT_EXPORT TextScannerError : class QMT_EXPORT TextScannerError :
...@@ -65,7 +65,7 @@ class QMT_EXPORT TextScanner : public QObject ...@@ -65,7 +65,7 @@ class QMT_EXPORT TextScanner : public QObject
{ {
Q_OBJECT Q_OBJECT
struct TextScannerPrivate; class TextScannerPrivate;
public: public:
explicit TextScanner(QObject *parent = 0); explicit TextScanner(QObject *parent = 0);
......
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
namespace qmt { namespace qmt {
struct SourceChar { class SourceChar
{
public:
SourceChar() { } SourceChar() { }
SourceChar(QChar chr, const SourcePos &sourcePos) SourceChar(QChar chr, const SourcePos &sourcePos)
: ch(chr), : ch(chr),
......
...@@ -54,7 +54,9 @@ ...@@ -54,7 +54,9 @@
namespace qmt { namespace qmt {
struct DiagramController::Clone { class DiagramController::Clone
{
public:
Clone(); Clone();
Uid m_elementKey; Uid m_elementKey;
int m_indexOfElement; int m_indexOfElement;
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
private: private:
struct Clone; class Clone;
class DiagramUndoCommand; class DiagramUndoCommand;
class UpdateElementCommand; class UpdateElementCommand;
......
...@@ -56,7 +56,9 @@ public: ...@@ -56,7 +56,9 @@ public:
Vcenter Vcenter
}; };
struct Latch { class Latch
{
public:
Latch() Latch()
: m_latchType(None), : m_latchType(None),
m_pos(0.0), m_pos(0.0),
......
...@@ -64,7 +64,9 @@ static const qreal MINIMUM_AUTO_WIDTH = 100.0; ...@@ -64,7 +64,9 @@ static const qreal MINIMUM_AUTO_WIDTH = 100.0;
static const qreal MINIMUM_AUTO_HEIGHT = 70.0; static const qreal MINIMUM_AUTO_HEIGHT = 70.0;
struct PackageItem::ShapeGeometry { class PackageItem::ShapeGeometry
{
public:
ShapeGeometry(const QSizeF &minimumSize, const QSizeF &minimumTabSize) ShapeGeometry(const QSizeF &minimumSize, const QSizeF &minimumTabSize)
: m_minimumSize(minimumSize), : m_minimumSize(minimumSize),
m_minimumTabSize(minimumTabSize) m_minimumTabSize(minimumTabSize)
......
...@@ -55,7 +55,7 @@ class PackageItem : ...@@ -55,7 +55,7 @@ class PackageItem :
public ObjectItem, public ObjectItem,
public IRelationable public IRelationable
{ {
struct ShapeGeometry; class ShapeGeometry;
public: public:
PackageItem(DPackage *package, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent = 0); PackageItem(DPackage *package, DiagramSceneModel *diagramSceneModel, QGraphicsItem *parent = 0);
......
...@@ -81,7 +81,9 @@ bool GeometryUtilities::intersect(const QPolygonF &polygon, const QLineF &line, ...@@ -81,7 +81,9 @@ bool GeometryUtilities::intersect(const QPolygonF &polygon, const QLineF &line,
namespace { namespace {
struct Candidate { class Candidate
{
public:
Candidate() : third(GeometryUtilities::SideUnspecified) { } Candidate() : third(GeometryUtilities::SideUnspecified) { }
Candidate(const QVector2D &f, const QPointF &s, GeometryUtilities::Side t) : first(f), second(s), third(t) { } Candidate(const QVector2D &f, const QPointF &s, GeometryUtilities::Side t) : first(f), second(s), third(t) { }
......
...@@ -45,11 +45,11 @@ class Handles ...@@ -45,11 +45,11 @@ class Handles
{ {
public: public:
typedef QList<Handle<T> > type; typedef QList<Handle<T> > value_type;
typedef typename type::iterator iterator; typedef typename value_type::iterator iterator;
typedef typename type::const_iterator const_iterator; typedef typename value_type::const_iterator const_iterator;
public: public:
...@@ -154,16 +154,16 @@ public: ...@@ -154,16 +154,16 @@ public:
public: public:
const type &get() const { return m_handleList; } const value_type &get() const { return m_handleList; }
type take() value_type take()
{ {
type handles = m_handleList; value_type handles = m_handleList;
m_handleList.clear(); m_handleList.clear();
return handles; return handles;
} }
void set(const type &handles) { void set(const value_type &handles) {
reset(); reset();
m_handleList = handles; m_handleList = handles;
} }
...@@ -259,7 +259,7 @@ public: ...@@ -259,7 +259,7 @@ public:
private: private:
type m_handleList; value_type m_handleList;
bool m_takeOwnership; bool m_takeOwnership;
}; };
......
...@@ -47,7 +47,9 @@ ...@@ -47,7 +47,9 @@
namespace qmt { namespace qmt {
struct ModelController::Clone { class ModelController::Clone
{
public:
Clone(); Clone();
ElementType m_elementType; ElementType m_elementType;
...@@ -379,7 +381,7 @@ public: ...@@ -379,7 +381,7 @@ public:
void add(MElement *element, MObject *owner) void add(MElement *element, MObject *owner)
{ {
struct Clone clone; ModelController::Clone clone;
clone.m_elementKey = element->uid(); clone.m_elementKey = element->uid();
clone.m_ownerKey = owner->uid(); clone.m_ownerKey = owner->uid();
......
...@@ -65,7 +65,7 @@ class QMT_EXPORT ModelController : ...@@ -65,7 +65,7 @@ class QMT_EXPORT ModelController :
TypeObject, TypeObject,
TypeRelation }; TypeRelation };
struct Clone; class Clone;
class UpdateObjectCommand; class UpdateObjectCommand;
class UpdateRelationCommand; class UpdateRelationCommand;
......
...@@ -301,7 +301,9 @@ QString ClassMembersEdit::Cursor::preparse(const QString &text) ...@@ -301,7 +301,9 @@ QString ClassMembersEdit::Cursor::preparse(const QString &text)
} }
struct ClassMembersEdit::ClassMembersEditPrivate { class ClassMembersEdit::ClassMembersEditPrivate
{
public:
ClassMembersEditPrivate() ClassMembersEditPrivate()
: m_valid(true) : m_valid(true)
{ {
......
...@@ -44,7 +44,7 @@ class QMT_EXPORT ClassMembersEdit : ...@@ -44,7 +44,7 @@ class QMT_EXPORT ClassMembersEdit :
Q_OBJECT Q_OBJECT
class Cursor; class Cursor;
struct ClassMembersEditPrivate; class ClassMembersEditPrivate;
public: public:
......
...@@ -51,7 +51,9 @@ QList<T *> CloneAll(const QList<T *> &rhs) ...@@ -51,7 +51,9 @@ QList<T *> CloneAll(const QList<T *> &rhs)
namespace qmt { namespace qmt {
struct IconShape::IconShapePrivate { class IconShape::IconShapePrivate
{
public:
IconShapePrivate() IconShapePrivate()
{ {
} }
......
...@@ -44,7 +44,7 @@ class ShapeConstVisitor; ...@@ -44,7 +44,7 @@ class ShapeConstVisitor;
class QMT_EXPORT IconShape class QMT_EXPORT IconShape
{ {
struct IconShapePrivate; class IconShapePrivate;
public: public:
......
...@@ -294,7 +294,9 @@ public: ...@@ -294,7 +294,9 @@ public:
TypeClose TypeClose
}; };
struct Element { class Element
{
public:
explicit Element(ElementType element = TypeNone) explicit Element(ElementType element = TypeNone)
: m_elementType(element), : m_elementType(element),
m_angle1(0.0), m_angle1(0.0),
......
...@@ -46,8 +46,9 @@ ...@@ -46,8 +46,9 @@
namespace qmt { namespace qmt {
struct StereotypeController::StereotypeControllerPrivate class StereotypeController::StereotypeControllerPrivate
{ {
public:
StereotypeControllerPrivate() StereotypeControllerPrivate()
{ {
} }
......
...@@ -48,7 +48,7 @@ class QMT_EXPORT StereotypeController : ...@@ -48,7 +48,7 @@ class QMT_EXPORT StereotypeController :
{ {
Q_OBJECT Q_OBJECT
struct StereotypeControllerPrivate; class StereotypeControllerPrivate;
public: public:
explicit StereotypeController(QObject *parent = 0); explicit StereotypeController(QObject *parent = 0);
......
...@@ -48,7 +48,9 @@ public: ...@@ -48,7 +48,9 @@ public:
TooltypeSeparator TooltypeSeparator
}; };
struct Tool { class Tool
{
public:
Tool() Tool()
: m_toolType(TooltypeSeparator) : m_toolType(TooltypeSeparator)
{ {
......
...@@ -49,7 +49,9 @@ namespace qmt { ...@@ -49,7 +49,9 @@ namespace qmt {
// TODO use tuple instead of these 4 explicit key classes // TODO use tuple instead of these 4 explicit key classes
struct ObjectStyleKey { class ObjectStyleKey
{
public:
ObjectStyleKey() ObjectStyleKey()
: m_elementType(StyleEngine::TypeOther) : m_elementType(StyleEngine::TypeOther)
{ {
...@@ -76,7 +78,9 @@ bool operator==(const ObjectStyleKey &lhs, const ObjectStyleKey &rhs) ...@@ -76,7 +78,9 @@ bool operator==(const ObjectStyleKey &lhs, const ObjectStyleKey &rhs)
} }
struct RelationStyleKey { class RelationStyleKey
{
public:
RelationStyleKey(StyleEngine::ElementType elementType = StyleEngine::TypeOther, RelationStyleKey(StyleEngine::ElementType elementType = StyleEngine::TypeOther,
DObject::VisualPrimaryRole visualPrimaryRole = DObject::PrimaryRoleNormal) DObject::VisualPrimaryRole visualPrimaryRole = DObject::PrimaryRoleNormal)
: m_elementType(elementType), : m_elementType(elementType),
...@@ -98,7 +102,9 @@ bool operator==(const RelationStyleKey &lhs, const RelationStyleKey &rhs) ...@@ -98,7 +102,9 @@ bool operator==(const RelationStyleKey &lhs, const RelationStyleKey &rhs)
} }
struct AnnotationStyleKey { class AnnotationStyleKey
{
public:
AnnotationStyleKey(DAnnotation::VisualRole visualRole = DAnnotation::RoleNormal) AnnotationStyleKey(DAnnotation::VisualRole visualRole = DAnnotation::RoleNormal)
: m_visualRole(visualRole) : m_visualRole(visualRole)
{ {
...@@ -117,7 +123,9 @@ bool operator==(const AnnotationStyleKey &lhs, const AnnotationStyleKey &rhs) ...@@ -117,7 +123,9 @@ bool operator==(const AnnotationStyleKey &lhs, const AnnotationStyleKey &rhs)
} }
struct BoundaryStyleKey { class BoundaryStyleKey
{
public:
BoundaryStyleKey() BoundaryStyleKey()
{ {
} }
...@@ -229,7 +237,9 @@ const Style *DefaultStyleEngine::applyObjectStyle(const Style *baseStyle, const ...@@ -229,7 +237,9 @@ const Style *DefaultStyleEngine::applyObjectStyle(const Style *baseStyle, const
{ {
ElementType elementType = objectType(styledObject.object()); ElementType elementType = objectType(styledObject.object());
struct DepthProperties { class DepthProperties
{
public:
DepthProperties() DepthProperties()
: m_elementType(TypeOther), : m_elementType(TypeOther),
m_visualPrimaryRole(DObject::PrimaryRoleNormal), m_visualPrimaryRole(DObject::PrimaryRoleNormal),
......
...@@ -45,10 +45,10 @@ QT_END_NAMESPACE ...@@ -45,10 +45,10 @@ QT_END_NAMESPACE
namespace qmt { namespace qmt {
struct ObjectStyleKey; class ObjectStyleKey;
struct RelationStyleKey; class RelationStyleKey;
struct AnnotationStyleKey; class AnnotationStyleKey;
struct BoundaryStyleKey; class BoundaryStyleKey;
class QMT_EXPORT DefaultStyleEngine : class QMT_EXPORT DefaultStyleEngine :
......
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
} }
private: private:
Flag::maskType m_flags; Flag::MaskType m_flags;
QHash<QString, QVariant> m_userData; QHash<QString, QVariant> m_userData;
}; };
......
...@@ -35,15 +35,15 @@ namespace qark { ...@@ -35,15 +35,15 @@ namespace qark {
class Flag { class Flag {
public: public:
typedef unsigned int maskType; typedef unsigned int MaskType;
explicit Flag() : m_mask(m_nextMask) { m_nextMask *= 2; } explicit Flag() : m_mask(m_nextMask) { m_nextMask *= 2; }
maskType mask() const { return m_mask; } MaskType mask() const { return m_mask; }
private: private:
static maskType m_nextMask; static MaskType m_nextMask;
maskType m_mask; MaskType m_mask;
}; };
} }
......
...@@ -61,13 +61,13 @@ public: ...@@ -61,13 +61,13 @@ public:
private: private: