From c68f49fefaab4251c70c4ccaece0dd52993b653a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sun, 20 Sep 2020 23:40:16 +0200 Subject: [PATCH] Remove unused private functions As found by Cppcheck. Change-Id: I697ea69992425ff41e35990ad00be312b35ba70a Reviewed-by: Christian Kandeler --- src/libs/cplusplus/CppDocument.h | 3 -- src/libs/cplusplus/ExpressionUnderCursor.cpp | 12 ------- src/libs/cplusplus/ExpressionUnderCursor.h | 1 - src/libs/qmljs/qmljsinterpreter.cpp | 19 ---------- src/libs/qmljs/qmljsinterpreter.h | 4 --- .../curveeditor/detail/selector.cpp | 35 ------------------- .../components/curveeditor/detail/selector.h | 4 --- 7 files changed, 78 deletions(-) diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index 3829d6f4ce2..4518b37c9e2 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -293,9 +293,6 @@ public: { return _beginLine; } private: - void setArguments(const QVector &arguments) - { _arguments = arguments; } - void addArgument(const Block &block) { _arguments.append(block); } diff --git a/src/libs/cplusplus/ExpressionUnderCursor.cpp b/src/libs/cplusplus/ExpressionUnderCursor.cpp index 6df396d8cfc..d53d0017752 100644 --- a/src/libs/cplusplus/ExpressionUnderCursor.cpp +++ b/src/libs/cplusplus/ExpressionUnderCursor.cpp @@ -225,18 +225,6 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in return index; } -bool ExpressionUnderCursor::isAccessToken(const Token &tk) -{ - switch (tk.kind()) { - case T_COLON_COLON: - case T_DOT: case T_ARROW: - case T_DOT_STAR: case T_ARROW_STAR: - return true; - default: - return false; - } // switch -} - QString ExpressionUnderCursor::operator()(const QTextCursor &cursor) { BackwardsScanner scanner(cursor, _languageFeatures); diff --git a/src/libs/cplusplus/ExpressionUnderCursor.h b/src/libs/cplusplus/ExpressionUnderCursor.h index 230e1967774..3ef515c8fc2 100644 --- a/src/libs/cplusplus/ExpressionUnderCursor.h +++ b/src/libs/cplusplus/ExpressionUnderCursor.h @@ -50,7 +50,6 @@ public: private: int startOfExpression(BackwardsScanner &tk, int index); int startOfExpression_helper(BackwardsScanner &tk, int index); - bool isAccessToken(const Token &tk); private: bool _jumpedComma; diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 3627e7b1747..87ba3984860 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -1080,25 +1080,6 @@ void ObjectValue::accept(ValueVisitor *visitor) const visitor->visit(this); } -bool ObjectValue::checkPrototype(const ObjectValue *, QSet *) const -{ -#if 0 - const int previousSize = processed->size(); - processed->insert(this); - - if (previousSize != processed->size()) { - if (this == proto) - return false; - - if (prototype() && ! prototype()->checkPrototype(proto, processed)) - return false; - - return true; - } -#endif - return false; -} - void ObjectValue::processMembers(MemberProcessor *processor) const { for (auto it = m_members.cbegin(), end = m_members.cend(); it != end; ++it) { diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h index 66c54f15f0b..fee30531f91 100644 --- a/src/libs/qmljs/qmljsinterpreter.h +++ b/src/libs/qmljs/qmljsinterpreter.h @@ -526,10 +526,6 @@ public: QString originId() const { return m_originId; } - -private: - bool checkPrototype(const ObjectValue *prototype, QSet *processed) const; - private: ValueOwner *m_valueOwner; QHash m_members; diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/selector.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/selector.cpp index 2ed74611e71..dd948a6ac28 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/selector.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/selector.cpp @@ -136,41 +136,6 @@ void Selector::mouseRelease(QMouseEvent *event, GraphicsScene *scene) m_rect = QRectF(); } -bool Selector::isOverMovableItem(const QPointF &pos, GraphicsScene *scene) -{ - auto intersect = [pos](QGraphicsObject *item) { - return item->mapRectToScene(item->boundingRect()).contains(pos); - }; - - const auto frames = scene->keyframes(); - for (auto *frame : frames) { - if (intersect(frame)) - return true; - - if (auto *leftHandle = frame->leftHandle()) { - if (intersect(leftHandle)) - return true; - } - - if (auto *rightHandle = frame->rightHandle()) { - if (intersect(rightHandle)) - return true; - } - } - return false; -} - -bool Selector::isOverSelectedKeyframe(const QPointF &pos, GraphicsScene *scene) -{ - const auto frames = scene->selectedKeyframes(); - for (auto *frame : frames) { - QRectF frameRect = frame->mapRectToScene(frame->boundingRect()); - if (frameRect.contains(pos)) - return true; - } - return false; -} - bool Selector::select(const SelectionTool &tool, const QPointF &pos, GraphicsScene *scene) { auto selectWidthTool = [this, diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/selector.h b/src/plugins/qmldesigner/components/curveeditor/detail/selector.h index 5b722439089..68674c838de 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/selector.h +++ b/src/plugins/qmldesigner/components/curveeditor/detail/selector.h @@ -50,10 +50,6 @@ public: void mouseRelease(QMouseEvent *event, GraphicsScene *scene); private: - bool isOverSelectedKeyframe(const QPointF &pos, GraphicsScene *scene); - - bool isOverMovableItem(const QPointF &pos, GraphicsScene *scene); - bool select(const SelectionTool &tool, const QPointF &pos, GraphicsScene *scene); bool pressSelection(SelectionMode mode, const QPointF &pos, GraphicsScene *scene);