From 5f05fb759edf99c739f149a48b5c413f4d95714f Mon Sep 17 00:00:00 2001 From: Erik Verbruggen <erik.verbruggen@nokia.com> Date: Tue, 8 Dec 2009 13:54:13 +0100 Subject: [PATCH] Removed unused code. --- src/plugins/qmleditor/qmlcodecompletion.cpp | 12 --- src/plugins/qmleditor/qmleditor.cpp | 101 -------------------- src/plugins/qmleditor/qmleditor.h | 2 - 3 files changed, 115 deletions(-) diff --git a/src/plugins/qmleditor/qmlcodecompletion.cpp b/src/plugins/qmleditor/qmlcodecompletion.cpp index bd67c5c8b83..325467c16d2 100644 --- a/src/plugins/qmleditor/qmlcodecompletion.cpp +++ b/src/plugins/qmleditor/qmlcodecompletion.cpp @@ -90,18 +90,6 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) m_startPosition = pos; m_completions.clear(); -// foreach (const QString &word, edit->keywords()) { -// TextEditor::CompletionItem item(this); -// item.m_text = word; -// m_completions.append(item); -// } -// -// foreach (const QString &word, edit->words()) { -// TextEditor::CompletionItem item(this); -// item.m_text = word; -// m_completions.append(item); -// } - QmlDocument::Ptr qmlDocument = edit->qmlDocument(); // qDebug() << "*** document:" << qmlDocument; if (qmlDocument.isNull()) diff --git a/src/plugins/qmleditor/qmleditor.cpp b/src/plugins/qmleditor/qmleditor.cpp index 60cfbbc2e88..406420c6463 100644 --- a/src/plugins/qmleditor/qmleditor.cpp +++ b/src/plugins/qmleditor/qmleditor.cpp @@ -77,101 +77,6 @@ using namespace SharedTools; namespace QmlEditor { namespace Internal { -class FindWords: protected Visitor -{ -public: - QStringList operator()(AST::Node *node) - { - _words.clear(); - accept(node); - return QStringList(_words.toList()); - } - -protected: - void accept(AST::Node *node) - { AST::Node::acceptChild(node, this); } - - using Visitor::visit; - using Visitor::endVisit; - - void addWords(AST::UiQualifiedId *id) - { - for (; id; id = id->next) { - if (id->name) - _words.insert(id->name->asString()); - } - } - - virtual bool visit(AST::UiPublicMember *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::UiQualifiedId *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::IdentifierExpression *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::FieldMemberExpression *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::FunctionExpression *node) - { - if (node->name) - _words.insert(node->name->asString()); - - for (AST::FormalParameterList *it = node->formals; it; it = it->next) { - if (it->name) - _words.insert(it->name->asString()); - } - - return true; - } - - virtual bool visit(AST::FunctionDeclaration *node) - { - if (node->name) - _words.insert(node->name->asString()); - - for (AST::FormalParameterList *it = node->formals; it; it = it->next) { - if (it->name) - _words.insert(it->name->asString()); - } - - return true; - } - - virtual bool visit(AST::VariableDeclaration *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - -private: - QSet<QString> _words; -}; - class FindIdDeclarations: protected Visitor { public: @@ -415,9 +320,6 @@ ScriptEditor::~ScriptEditor() QList<Declaration> ScriptEditor::declarations() const { return m_declarations; } -QStringList ScriptEditor::words() const -{ return m_words; } - Core::IEditor *ScriptEditorEditable::duplicate(QWidget *parent) { ScriptEditor *newEditor = new ScriptEditor(parent); @@ -466,9 +368,6 @@ void ScriptEditor::onDocumentUpdated(QmlEditor::QmlDocument::Ptr doc) FindDeclarations findDeclarations; m_declarations = findDeclarations(doc->program()); - FindWords findWords; - m_words = findWords(doc->program()); - QStringList items; items.append(tr("<Select Symbol>")); diff --git a/src/plugins/qmleditor/qmleditor.h b/src/plugins/qmleditor/qmleditor.h index a29110039b3..7746ddf82d9 100644 --- a/src/plugins/qmleditor/qmleditor.h +++ b/src/plugins/qmleditor/qmleditor.h @@ -101,7 +101,6 @@ public: ~ScriptEditor(); QList<Declaration> declarations() const; - QStringList words() const; QStringList keywords() const; QList<QmlJS::DiagnosticMessage> diagnosticMessages() const @@ -145,7 +144,6 @@ private: QTimer *m_updateDocumentTimer; QComboBox *m_methodCombo; QList<Declaration> m_declarations; - QStringList m_words; QMap<QString, QList<QmlJS::AST::SourceLocation> > m_ids; // ### use QMultiMap QList<QmlJS::DiagnosticMessage> m_diagnosticMessages; QmlDocument::Ptr m_document; -- GitLab