From 06a00097864e8b8f2c0346d14f73ea5e95af2bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 8 Jan 2019 14:17:17 +0100 Subject: [PATCH] Removed WhatsThisGenerator from Baseinterface --- BasePlugin/BaseInterface.hh | 1 - common/BaseObject.cc | 33 ++++++++++++++++++++++++++++++++- common/BaseObject.hh | 28 +++++++--------------------- 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/BasePlugin/BaseInterface.hh b/BasePlugin/BaseInterface.hh index dab613f6..ecbdc72a 100644 --- a/BasePlugin/BaseInterface.hh +++ b/BasePlugin/BaseInterface.hh @@ -42,7 +42,6 @@ #pragma once #include -#include "WhatsThisGenerator.hh" /** \file BaseInterface.hh diff --git a/common/BaseObject.cc b/common/BaseObject.cc index 6b71c271..d3b22f4d 100644 --- a/common/BaseObject.cc +++ b/common/BaseObject.cc @@ -821,7 +821,38 @@ deleteData() { } -/** Returns a flat, human readable representation of all comments. */ +QString& BaseObject::getCommentByKey(const QString &key) { + return commentsByKey_[key]; + } + + + const QString BaseObject::getCommentByKey(const QString &key) const { + return commentsByKey_.value(key); + } + + + bool BaseObject::hasCommentForKey(const QString &key) const { + return commentsByKey_.contains(key); + } + + + bool BaseObject::hasComments() const { + return !commentsByKey_.empty(); + } + + void BaseObject::clearComment(const QString &key) { + commentsByKey_.remove(key); + } + + void BaseObject::clearAllComments() { + commentsByKey_.clear(); + } + + + const QMap& BaseObject::getAllComments() const { + return commentsByKey_; + } + const QString BaseObject::getAllCommentsFlat() const { QStringList result; diff --git a/common/BaseObject.hh b/common/BaseObject.hh index 6da95857..3901ae03 100644 --- a/common/BaseObject.hh +++ b/common/BaseObject.hh @@ -541,41 +541,27 @@ class DLLEXPORT BaseObject : public QObject { * If no comment with the specified exists, an empty * one is created. */ - QString &getCommentByKey(const QString &key) { - return commentsByKey_[key]; - } + QString &getCommentByKey(const QString &key); /** \brief Get comment for the specified key. * * If no comment with the specified exists, an empty comment * is returned (but not inserted into the map). */ - const QString getCommentByKey(const QString &key) const { - return commentsByKey_.value(key); - } + const QString getCommentByKey(const QString &key) const; /** Returns true if a comment for the specified key exists, false otherwise. */ - bool hasCommentForKey(const QString &key) const { - return commentsByKey_.contains(key); - } + bool hasCommentForKey(const QString &key) const; /** Indicates whether any comment has been supplied for this object. */ - bool hasComments() const { - return !commentsByKey_.empty(); - } + bool hasComments() const; - void clearComment(const QString &key) { - commentsByKey_.remove(key); - } + void clearComment(const QString &key); - void clearAllComments() { - commentsByKey_.clear(); - } + void clearAllComments(); /** Returns a reference to all comments. */ - const QMap &getAllComments() const { - return commentsByKey_; - } + const QMap &getAllComments() const; /** Returns a flat, human readable representation of all comments. */ const QString getAllCommentsFlat() const; -- GitLab