From 7b45f784e622d2353cfad15bd3447c3bd4bb6a42 Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Sun, 26 Jun 2011 18:00:46 +0200 Subject: [PATCH] no more definitions of get functions in headers --- include/argumentparser.h | 6 +++--- include/edge.h | 12 ++++++------ include/node.h | 4 ++-- include/systemtray.h | 2 +- src/argumentparser.cpp | 15 +++++++++++++++ src/edge.cpp | 30 ++++++++++++++++++++++++++++++ src/node.cpp | 10 ++++++++++ src/systemtray.cpp | 5 +++++ 8 files changed, 72 insertions(+), 12 deletions(-) diff --git a/include/argumentparser.h b/include/argumentparser.h index d2d4718..ab4efa7 100644 --- a/include/argumentparser.h +++ b/include/argumentparser.h @@ -21,9 +21,9 @@ public: */ bool parseCmdLineArgs(bool &successful); - bool isSystemTray() { return m_isSystemTray; } - bool isShowMinimized() { return m_isShowMinimized; } - QString filePath() { return m_filePath; } + bool isSystemTray(); + bool isShowMinimized(); + QString filePath(); private: diff --git a/include/edge.h b/include/edge.h index e3efcf4..1bda57f 100644 --- a/include/edge.h +++ b/include/edge.h @@ -13,16 +13,16 @@ public: Edge(Node *sourceNode, Node *destNode); ~Edge(); - Node *sourceNode() const { return m_sourceNode; } - Node *destNode() const { return m_destNode; } - double angle() const { return m_angle; } + Node *sourceNode() const; + Node *destNode() const; + double angle() const; // set/get color/width/secondary - QColor color() const { return m_color; } + QColor color() const; void setColor(const QColor &color); - qreal width() const { return m_width; } + qreal width() const; void setWidth(const qreal &width); - bool secondary() const { return m_secondary; } + bool secondary() const; void setSecondary(const bool &sec = true ); // re-calculates the source and endpoint. diff --git a/include/node.h b/include/node.h index 83ec857..50fd4d7 100644 --- a/include/node.h +++ b/include/node.h @@ -33,9 +33,9 @@ public: void setBorder(const bool &hasBorder = true); void setEditable(const bool &editable = true); void setColor(const QColor &color); - QColor color() const { return m_color; } + QColor color() const; void setTextColor(const QColor &color); - QColor textColor() const { return m_textColor; } + QColor textColor() const; void setScale(const qreal &factor, const QRectF &sceneRect); // show numbers in hint mode diff --git a/include/systemtray.h b/include/systemtray.h index 2c4dc66..36814be 100644 --- a/include/systemtray.h +++ b/include/systemtray.h @@ -16,7 +16,7 @@ public: explicit SystemTray(MainWindow *mainWindow, QWidget *parent = 0); // access private member - void show() { m_systemTrayIcon->show(); } + void show(); private: diff --git a/src/argumentparser.cpp b/src/argumentparser.cpp index a81cf8d..e4dd9a6 100644 --- a/src/argumentparser.cpp +++ b/src/argumentparser.cpp @@ -104,3 +104,18 @@ bool ArgumentParser::parseCmdLineArgs(bool &successful) } return true; } + +bool ArgumentParser::isSystemTray() +{ + return m_isSystemTray; +} + +bool ArgumentParser::isShowMinimized() +{ + return m_isShowMinimized; +} + +QString ArgumentParser::filePath() +{ + return m_filePath; +} diff --git a/src/edge.cpp b/src/edge.cpp index b9d1782..4c77390 100644 --- a/src/edge.cpp +++ b/src/edge.cpp @@ -34,12 +34,37 @@ Edge::~Edge() m_destNode->removeEdgeFromList(this); } +Node * Edge::sourceNode() const +{ + return m_sourceNode; +} + +Node * Edge::destNode() const +{ + return m_destNode; +} + +double Edge::angle() const +{ + return m_angle; +} + +QColor Edge::color() const +{ + return m_color; +} + void Edge::setColor(const QColor &color) { m_color = color; update(); } +qreal Edge::width() const +{ + return m_width; +} + void Edge::setWidth(const qreal &width) { if (width < 1 || width > 100) @@ -49,6 +74,11 @@ void Edge::setWidth(const qreal &width) update(); } +bool Edge::secondary() const +{ + return m_secondary; +} + void Edge::setSecondary(const bool &sec) { m_secondary = sec; diff --git a/src/node.cpp b/src/node.cpp index 4680199..d7dab68 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -175,12 +175,22 @@ void Node::setColor(const QColor &color) update(); } +QColor Node::color() const +{ + return m_color; +} + void Node::setTextColor(const QColor &color) { m_textColor = color; update(); } +QColor Node::textColor() const +{ + return m_textColor; +} + void Node::setScale(const qreal &factor,const QRectF &sceneRect) { // limit scale to a reasonable size diff --git a/src/systemtray.cpp b/src/systemtray.cpp index 5cf23a8..3847eb7 100644 --- a/src/systemtray.cpp +++ b/src/systemtray.cpp @@ -37,3 +37,8 @@ SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent) m_icon = new QIcon(":/qtmindmap.svg"); m_systemTrayIcon->setIcon(QIcon(":/qtmindmap.svg")); } + +void SystemTray::show() +{ + m_systemTrayIcon->show(); +}