Use more API style foo(), not getFoo(), for getting "foo"

parent 9d104f58
......@@ -545,7 +545,7 @@ QString VariableProvider::textHint(KTextEditor::View* view, const KTextEditor::C
w = view;
m_collection->m_activeTooltip = new VariableToolTip(w, global+QPoint(30,30), expression);
m_collection->m_activeTooltip->setHandleRect(KTextEditorHelpers::getItemBoundingRect(view, expressionRange));
m_collection->m_activeTooltip->setHandleRect(KTextEditorHelpers::itemBoundingRect(view, expressionRange));
return QString();
}
......
......@@ -107,7 +107,7 @@ int ClassModel::rowCount(const QModelIndex& parent) const
if ( parent.isValid() )
node = static_cast<Node*>(parent.internalPointer());
return node->getChildren().size();
return node->children().size();
}
QVariant ClassModel::data(const QModelIndex& index, int role) const
......@@ -122,7 +122,7 @@ QVariant ClassModel::data(const QModelIndex& index, int role) const
if ( role == Qt::DecorationRole )
{
QIcon icon = node->getCachedIcon();
QIcon icon = node->cachedIcon();
return icon.isNull() ? QVariant() : icon;
}
......@@ -161,10 +161,10 @@ QModelIndex ClassModel::index(int row, int column, const QModelIndex& parent) co
if ( parent.isValid() )
node = static_cast<Node*>(parent.internalPointer());
if ( row >= node->getChildren().size() )
if ( row >= node->children().size() )
return QModelIndex();
return index(node->getChildren()[row]);
return index(node->children()[row]);
}
QModelIndex ClassModel::parent(const QModelIndex& childIndex) const
......@@ -174,10 +174,10 @@ QModelIndex ClassModel::parent(const QModelIndex& childIndex) const
Node* childNode = static_cast<Node*>(childIndex.internalPointer());
if ( childNode->getParent() == m_topNode )
if ( childNode->parent() == m_topNode )
return QModelIndex();
return index( childNode->getParent() );
return index( childNode->parent() );
}
QModelIndex ClassModel::index(ClassModelNodes::Node* a_node) const
......@@ -187,7 +187,7 @@ QModelIndex ClassModel::index(ClassModelNodes::Node* a_node) const
}
// If no parent exists, we have an invalid index (root node or not part of a model).
if ( a_node->getParent() == nullptr )
if ( a_node->parent() == nullptr )
return QModelIndex();
return createIndex(a_node->row(), 0, a_node);
......@@ -201,13 +201,13 @@ KDevelop::DUChainBase* ClassModel::duObjectForIndex(const QModelIndex& a_index)
Node* node = static_cast<Node*>(a_index.internalPointer());
if ( IdentifierNode* identifierNode = dynamic_cast<IdentifierNode*>(node) )
return identifierNode->getDeclaration();
return identifierNode->declaration();
// Non was found.
return nullptr;
}
QModelIndex ClassModel::getIndexForIdentifier(const KDevelop::IndexedQualifiedIdentifier& a_id)
QModelIndex ClassModel::indexForIdentifier(const KDevelop::IndexedQualifiedIdentifier& a_id)
{
ClassNode* node = m_allClassesNode->findClassNode(a_id);
if ( node == nullptr )
......
......@@ -93,7 +93,7 @@ public:
KDevelop::DUChainBase* duObjectForIndex(const QModelIndex& a_index);
/// Call this to retrieve the index for the node associated with the specified id.
QModelIndex getIndexForIdentifier(const KDevelop::IndexedQualifiedIdentifier& a_id);
QModelIndex indexForIdentifier(const KDevelop::IndexedQualifiedIdentifier& a_id);
/// Return the model index associated with the given node.
QModelIndex index(ClassModelNodes::Node* a_node) const;
......
......@@ -49,7 +49,7 @@ IdentifierNode::IdentifierNode(KDevelop::Declaration* a_decl,
{
}
Declaration* IdentifierNode::getDeclaration()
Declaration* IdentifierNode::declaration()
{
if ( !m_cachedDeclaration )
m_cachedDeclaration = m_indexedDeclaration.declaration();
......@@ -61,7 +61,7 @@ bool IdentifierNode::getIcon(QIcon& a_resultIcon)
{
DUChainReadLocker readLock(DUChain::lock());
Declaration* decl = getDeclaration();
Declaration* decl = declaration();
if ( decl )
a_resultIcon = DUChainUtils::iconForDeclaration(decl);
......@@ -83,7 +83,7 @@ bool EnumNode::getIcon(QIcon& a_resultIcon)
{
DUChainReadLocker readLock(DUChain::lock());
ClassMemberDeclaration* decl = dynamic_cast<ClassMemberDeclaration*>(getDeclaration());
ClassMemberDeclaration* decl = dynamic_cast<ClassMemberDeclaration*>(declaration());
if ( decl == nullptr )
{
static QIcon Icon = QIcon::fromTheme(QStringLiteral("enum"));
......@@ -115,7 +115,7 @@ void EnumNode::populateNode()
{
DUChainReadLocker readLock(DUChain::lock());
Declaration* decl = getDeclaration();
Declaration* decl = declaration();
if ( decl->internalContext() )
foreach( Declaration* enumDecl, decl->internalContext()->localDeclarations() )
......@@ -147,7 +147,7 @@ void ClassNode::populateNode()
{
if ( updateClassDeclarations() )
{
m_cachedUrl = getDeclaration()->url();
m_cachedUrl = declaration()->url();
ClassModelNodesController::self().registerForChanges(m_cachedUrl, this);
}
}
......@@ -159,7 +159,7 @@ void ClassNode::populateNode()
template <> inline bool qMapLessThanKey(const IndexedIdentifier &key1, const IndexedIdentifier &key2)
{
return key1.getIndex() < key2.getIndex();
return key1.index() < key2.index();
}
bool ClassNode::updateClassDeclarations()
......@@ -167,7 +167,7 @@ bool ClassNode::updateClassDeclarations()
bool hadChanges = false;
SubIdentifiersMap existingIdentifiers = m_subIdentifiers;
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>(getDeclaration());
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>(declaration());
if ( klass )
{
......@@ -278,7 +278,7 @@ ClassNode* ClassNode::findSubClass(const KDevelop::IndexedQualifiedIdentifier& a
if ( classNode == nullptr )
continue;
if ( classNode->getIdentifier() == a_id )
if ( classNode->identifier() == a_id )
return classNode;
}
......@@ -320,7 +320,7 @@ bool ClassMemberNode::getIcon(QIcon& a_resultIcon)
{
DUChainReadLocker readLock(DUChain::lock());
ClassMemberDeclaration* decl = dynamic_cast<ClassMemberDeclaration*>(getDeclaration());
ClassMemberDeclaration* decl = dynamic_cast<ClassMemberDeclaration*>(declaration());
if ( decl == nullptr )
return false;
......@@ -391,7 +391,7 @@ void BaseClassesFolderNode::populateNode()
{
DUChainReadLocker readLock(DUChain::lock());
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>( static_cast<ClassNode*>(getParent())->getDeclaration() );
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>( static_cast<ClassNode*>(parent())->declaration() );
if ( klass )
{
// I use the imports instead of the baseClasses in the ClassDeclaration because I need
......@@ -426,11 +426,11 @@ void DerivedClassesFolderNode::populateNode()
{
DUChainReadLocker readLock(DUChain::lock());
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>( static_cast<ClassNode*>(getParent())->getDeclaration() );
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>( static_cast<ClassNode*>(parent())->declaration() );
if ( klass )
{
uint steps = 10000;
const QList<Declaration*> inheriters = DUChainUtils::getInheriters(klass, steps, true);
const QList<Declaration*> inheriters = DUChainUtils::inheriters(klass, steps, true);
for (Declaration* decl : inheriters) {
addNode( new ClassNode(decl, m_model) );
......@@ -490,12 +490,12 @@ struct SortNodesFunctor
{
bool operator() (Node* a_lhs, Node* a_rhs)
{
if ( a_lhs->getScore() == a_rhs->getScore() )
if ( a_lhs->score() == a_rhs->score() )
{
return a_lhs->getSortableString() < a_rhs->getSortableString();
return a_lhs->sortableString() < a_rhs->sortableString();
}
else
return a_lhs->getScore() < a_rhs->getScore();
return a_lhs->score() < a_rhs->score();
}
};
......@@ -526,7 +526,7 @@ int Node::row()
return m_parentNode->m_children.indexOf(this);
}
QIcon ClassModelNodes::Node::getCachedIcon()
QIcon ClassModelNodes::Node::cachedIcon()
{
// Load the cached icon if it's null.
if ( m_cachedIcon.isNull() )
......
......@@ -75,7 +75,7 @@ public: // Operations
public: // Info retrieval
/// Return the parent associated with this node.
Node* getParent() const { return m_parentNode; }
Node* parent() const { return m_parentNode; }
/// Get my index in the parent node
int row();
......@@ -84,21 +84,21 @@ public: // Info retrieval
QString displayName() const { return m_displayName; }
/// Returns a list of child nodes
const QList<Node*>& getChildren() const { return m_children; }
const QList<Node*>& children() const { return m_children; }
/// Return an icon representation for the node.
/// @note It calls the internal getIcon and caches the result.
QIcon getCachedIcon();
QIcon cachedIcon();
public: // overridables
/// Return a score when sorting the nodes.
virtual int getScore() const = 0;
virtual int score() const = 0;
/// Return true if the node contains sub-nodes.
virtual bool hasChildren() const { return !m_children.empty(); }
/// We use this string when sorting items.
virtual QString getSortableString() const { return m_displayName; }
virtual QString sortableString() const { return m_displayName; }
protected:
/// fill a_resultIcon with a display icon for the node.
......@@ -167,7 +167,7 @@ public:
public:
/// Returns the qualified identifier for this node by going through the tree
const KDevelop::IndexedQualifiedIdentifier& getIdentifier() const { return m_identifier; }
const KDevelop::IndexedQualifiedIdentifier& identifier() const { return m_identifier; }
public: // Node overrides
bool getIcon(QIcon& a_resultIcon) override;
......@@ -175,7 +175,7 @@ public: // Node overrides
public: // Overridables
/// Return the associated declaration
/// @note DU CHAIN MUST BE LOCKED FOR READ
virtual KDevelop::Declaration* getDeclaration();
virtual KDevelop::Declaration* declaration();
private:
KDevelop::IndexedQualifiedIdentifier m_identifier;
......@@ -193,7 +193,7 @@ public:
EnumNode(KDevelop::Declaration* a_decl, NodesModelInterface* a_model);
public: // Node overrides
int getScore() const override { return 102; }
int score() const override { return 102; }
bool getIcon(QIcon& a_resultIcon) override;
void populateNode() override;
};
......@@ -213,7 +213,7 @@ public:
ClassNode* findSubClass(const KDevelop::IndexedQualifiedIdentifier& a_id);
public: // Node overrides
int getScore() const override { return 300; }
int score() const override { return 300; }
void populateNode() override;
void nodeCleared() override;
bool hasChildren() const override { return true; }
......@@ -249,8 +249,8 @@ public:
FunctionNode(KDevelop::Declaration* a_decl, NodesModelInterface* a_model);
public: // Node overrides
int getScore() const override { return 400; }
QString getSortableString() const override { return m_sortableString; }
int score() const override { return 400; }
QString sortableString() const override { return m_sortableString; }
private:
QString m_sortableString;
......@@ -266,7 +266,7 @@ public:
ClassMemberNode(KDevelop::ClassMemberDeclaration* a_decl, NodesModelInterface* a_model);
public: // Node overrides
int getScore() const override { return 500; }
int score() const override { return 500; }
bool getIcon(QIcon& a_resultIcon) override;
};
......@@ -281,7 +281,7 @@ public:
public: // Node overrides
bool getIcon(QIcon& a_resultIcon) override;
int getScore() const override { return 100; }
int score() const override { return 100; }
};
//////////////////////////////////////////////////////////////////////////////
......@@ -295,7 +295,7 @@ public:
public: // Node overrides
bool getIcon(QIcon& a_resultIcon) override;
int getScore() const override { return 100; }
int score() const override { return 100; }
};
//////////////////////////////////////////////////////////////////////////////
......
......@@ -49,7 +49,7 @@ public:
public: // Node overrides
bool getIcon(QIcon& a_resultIcon) override;
int getScore() const override { return 101; }
int score() const override { return 101; }
private:
/// The namespace identifier.
......@@ -128,7 +128,7 @@ void DocumentClassesFolder::populateNode()
m_updateTimer->start();
}
QSet< KDevelop::IndexedString > DocumentClassesFolder::getAllOpenDocuments()
QSet<KDevelop::IndexedString> DocumentClassesFolder::allOpenDocuments() const
{
return m_openFiles;
}
......@@ -245,7 +245,7 @@ bool DocumentClassesFolder::updateDocument(const KDevelop::IndexedString& a_file
if ( item.kind & CodeModelItem::Namespace )
{
// This should create the namespace folder and add it to the cache.
getNamespaceFolder(id);
namespaceFolder(id);
// Add to the locally created namespaces.
declaredNamespaces.insert(id);
......@@ -306,7 +306,7 @@ bool DocumentClassesFolder::updateDocument(const KDevelop::IndexedString& a_file
if ( decls->declaration()->kind() == Declaration::Namespace )
{
// This should create the namespace folder and add it to the cache.
parentNode = getNamespaceFolder(parentIdentifier);
parentNode = namespaceFolder(parentIdentifier);
// Add to the locally created namespaces.
declaredNamespaces.insert(parentIdentifier);
......@@ -385,7 +385,7 @@ void DocumentClassesFolder::removeClassNode(ClassModelNodes::ClassNode* a_node)
{
// Get the parent namespace identifier.
QualifiedIdentifier parentNamespaceIdentifier;
if ( auto namespaceParent = dynamic_cast<StaticNamespaceFolderNode*>(a_node->getParent()) )
if ( auto namespaceParent = dynamic_cast<StaticNamespaceFolderNode*>(a_node->parent()) )
{
parentNamespaceIdentifier = namespaceParent->qualifiedIdentifier();
}
......@@ -418,7 +418,7 @@ void DocumentClassesFolder::removeEmptyNamespace(const QualifiedIdentifier& a_id
}
}
StaticNamespaceFolderNode* DocumentClassesFolder::getNamespaceFolder(const KDevelop::QualifiedIdentifier& a_identifier)
StaticNamespaceFolderNode* DocumentClassesFolder::namespaceFolder(const KDevelop::QualifiedIdentifier& a_identifier)
{
// Stop condition.
if ( a_identifier.count() == 0 )
......@@ -429,7 +429,7 @@ StaticNamespaceFolderNode* DocumentClassesFolder::getNamespaceFolder(const KDeve
if ( iter == m_namespaces.end() )
{
// It's not in the cache - create folders up to it.
Node* parentNode = getNamespaceFolder(a_identifier.left(-1));
Node* parentNode = namespaceFolder(a_identifier.left(-1));
if ( parentNode == nullptr )
parentNode = this;
......
......@@ -54,7 +54,7 @@ protected: // Documents list handling.
void closeDocument(const KDevelop::IndexedString& a_file);
/// Returns a list of documents we have monitored.
QSet< KDevelop::IndexedString > getAllOpenDocuments();
QSet<KDevelop::IndexedString> allOpenDocuments() const;
protected: // Overridables
/// Override this to filter the found classes.
......@@ -141,7 +141,7 @@ private:
/// Recursively create a namespace folder for the specified identifier if it doesn't
/// exist, cache it and return it (or just return it from the cache).
StaticNamespaceFolderNode* getNamespaceFolder(const KDevelop::QualifiedIdentifier& a_identifier);
StaticNamespaceFolderNode* namespaceFolder(const KDevelop::QualifiedIdentifier& a_identifier);
/// Removes the given namespace identifier recursively if it's empty.
void removeEmptyNamespace(const KDevelop::QualifiedIdentifier& a_identifier);
......
......@@ -201,11 +201,12 @@ struct InsertIntoDUChain
}
///Helper function: get a declaration based on its qualified identifier
Declaration* getDeclaration(const QString& id) {
Declaration* declaration(const QString& id)
{
get();
if(!topContext())
return nullptr;
return DeclarationId(IndexedQualifiedIdentifier(QualifiedIdentifier(id))).getDeclaration(topContext());
return DeclarationId(IndexedQualifiedIdentifier(QualifiedIdentifier(id))).declaration(topContext());
}
TopDUContext* topContext() {
......
......@@ -117,7 +117,7 @@ FunctionDescription::FunctionDescription(const DeclarationPointer& declaration)
DUChainPointer<FunctionDeclaration> function = declaration.dynamicCast<FunctionDeclaration>();
if (function)
{
context = DUChainUtils::getArgumentContext(declaration.data());
context = DUChainUtils::argumentContext(declaration.data());
}
DUChainPointer<ClassFunctionDeclaration> method = declaration.dynamicCast<ClassFunctionDeclaration>();
......@@ -129,7 +129,7 @@ FunctionDescription::FunctionDescription(const DeclarationPointer& declaration)
isVirtual = method->isVirtual();
isAbstract = method->isAbstract();
isFinal = method->isFinal();
isOverriding = (DUChainUtils::getOverridden(method.data()) != nullptr);
isOverriding = (DUChainUtils::overridden(method.data()) != nullptr);
isStatic = method->isStatic();
isSlot = method->isSlot();
isSignal = method->isSignal();
......
......@@ -285,7 +285,7 @@ void TemplateClassGenerator::addBaseClass(const QString& base)
DUChainReadLocker lock;
PersistentSymbolTable::Declarations decl = PersistentSymbolTable::self().getDeclarations(IndexedQualifiedIdentifier(QualifiedIdentifier(desc.baseType)));
PersistentSymbolTable::Declarations decl = PersistentSymbolTable::self().declarations(IndexedQualifiedIdentifier(QualifiedIdentifier(desc.baseType)));
//Search for all super classes
for(PersistentSymbolTable::Declarations::Iterator it = decl.iterator(); it; ++it)
......
......@@ -88,7 +88,7 @@ class TemporaryDataManager {
delete m_items.at(a);
}
inline T& getItem(int index) {
inline T& item(int index) {
//For performance reasons this function does not lock the mutex, it's called too often and must be
//extremely fast. There is special measures in alloc() to make this safe.
Q_ASSERT(index & DynamicAppendedListMask);
......@@ -96,7 +96,7 @@ class TemporaryDataManager {
return *m_items.at(index & KDevelop::DynamicAppendedListRevertMask);
}
///Allocates an item index, which from now on you can get using getItem, until you call free(..) on the index.
///Allocates an item index, which from now on you can get using item(), until you call free(..) on the index.
///The returned item is not initialized and may contain random older content, so you should clear it after getting it for the first time
int alloc() {
......@@ -129,7 +129,7 @@ class TemporaryDataManager {
m_deleteLater.removeFirst();
}
//The only function that does not lock the mutex is getItem(..), because that function must be very efficient.
//The only function that does not lock the mutex is item(..), because that function must be very efficient.
//Since it's only a few instructions from the moment m_items is read to the moment it's used,
//deleting the old data after a few seconds should be safe.
m_deleteLater.append(qMakePair(now, oldItems));
......@@ -249,14 +249,14 @@ class TemporaryDataManager {
#define APPENDED_LIST_COMMON(container, type, name) \
uint name ## Data; \
unsigned int name ## Size() const { if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return 0; if(!appendedListsDynamic()) return name ## Data; else return temporaryHash ## container ## name().getItem(name ## Data).size(); } \
KDevVarLengthArray<type, 10>& name ## List() { name ## NeedDynamicList(); return temporaryHash ## container ## name().getItem(name ## Data); }\
unsigned int name ## Size() const { if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return 0; if(!appendedListsDynamic()) return name ## Data; else return temporaryHash ## container ## name().item(name ## Data).size(); } \
KDevVarLengthArray<type, 10>& name ## List() { name ## NeedDynamicList(); return temporaryHash ## container ## name().item(name ## Data); }\
template<class T> bool name ## Equals(const T& rhs) const { unsigned int size = name ## Size(); if(size != rhs.name ## Size()) return false; for(uint a = 0; a < size; ++a) {if(!(name()[a] == rhs.name()[a])) return false;} return true; } \
template<class T> void name ## CopyFrom( const T& rhs ) { \
if(rhs.name ## Size() == 0 && (name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return; \
if(appendedListsDynamic()) { \
name ## NeedDynamicList(); \
KDevVarLengthArray<type, 10>& item( temporaryHash ## container ## name().getItem(name ## Data) ); \
KDevVarLengthArray<type, 10>& item( temporaryHash ## container ## name().item(name ## Data) ); \
item.clear(); \
const type* otherCurr = rhs.name(); \
const type* otherEnd = otherCurr + rhs.name ## Size(); \
......@@ -275,7 +275,7 @@ class TemporaryDataManager {
Q_ASSERT(appendedListsDynamic()); \
if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) {\
name ## Data = temporaryHash ## container ## name().alloc();\
Q_ASSERT(temporaryHash ## container ## name().getItem(name ## Data).isEmpty()); \
Q_ASSERT(temporaryHash ## container ## name().item(name ## Data).isEmpty()); \
} \
} \
void name ## Initialize(bool dynamic) { name ## Data = (dynamic ? KDevelop::DynamicAppendedListMask : 0); } \
......@@ -297,7 +297,7 @@ class TemporaryDataManager {
const type* name() const { \
if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return nullptr; \
if(!appendedListsDynamic()) return reinterpret_cast<const type*>(reinterpret_cast<const char*>(this) + classSize() + offsetBehindBase()); \
else return temporaryHash ## container ## name().getItem(name ## Data).data(); \
else return temporaryHash ## container ## name().item(name ## Data).data(); \
} \
unsigned int name ## OffsetBehind() const { return name ## Size() * sizeof(type) + offsetBehindBase(); } \
template<class T> bool name ## ListChainEquals( const T& rhs ) const { return name ## Equals(rhs); } \
......@@ -310,7 +310,7 @@ class TemporaryDataManager {
const type* name() const {\
if((name ## Data & KDevelop::DynamicAppendedListRevertMask) == 0) return nullptr; \
if(!appendedListsDynamic()) return reinterpret_cast<const type*>(reinterpret_cast<const char*>(this) + classSize() + predecessor ## OffsetBehind()); \
else return temporaryHash ## container ## name().getItem(name ## Data).data(); \
else return temporaryHash ## container ## name().item(name ## Data).data(); \
} \
unsigned int name ## OffsetBehind() const { return name ## Size() * sizeof(type) + predecessor ## OffsetBehind(); } \
template<class T> bool name ## ListChainEquals( const T& rhs ) const { return name ## Equals(rhs) && predecessor ## ListChainEquals(rhs); } \
......
......@@ -350,7 +350,7 @@ void Declaration::allocateOwnIndex() {
m_indexInTopContext = m_topContext->m_dynamicData->allocateDeclarationIndex(this, d_func()->m_anonymousInContext || !context() || context()->isAnonymous());
Q_ASSERT(m_indexInTopContext);
if(!m_topContext->m_dynamicData->getDeclarationForIndex(m_indexInTopContext))
if(!m_topContext->m_dynamicData->declarationForIndex(m_indexInTopContext))
qFatal("Could not re-retrieve declaration\nindex: %d", m_indexInTopContext);
}
......
......@@ -95,7 +95,7 @@ IndexedInstantiationInformation DeclarationId::specialization() const
return m_specialization;
}
KDevVarLengthArray<Declaration*> DeclarationId::getDeclarations(const TopDUContext* top) const
KDevVarLengthArray<Declaration*> DeclarationId::declarations(const TopDUContext* top) const
{
KDevVarLengthArray<Declaration*> ret;
......@@ -106,7 +106,7 @@ KDevVarLengthArray<Declaration*> DeclarationId::getDeclarations(const TopDUConte
if(top) {
//Do filtering
PersistentSymbolTable::FilteredDeclarationIterator filter =
PersistentSymbolTable::self().getFilteredDeclarations(id, top->recursiveImportIndices());
PersistentSymbolTable::self().filteredDeclarations(id, top->recursiveImportIndices());
for(; filter; ++filter) {
Declaration* decl = filter->data();
if(decl && m_indirectData.additionalIdentity == decl->additionalIdentity()) {
......@@ -116,7 +116,7 @@ KDevVarLengthArray<Declaration*> DeclarationId::getDeclarations(const TopDUConte
}
}else{
//Just accept anything
PersistentSymbolTable::Declarations decls = PersistentSymbolTable::self().getDeclarations(id);
PersistentSymbolTable::Declarations decls = PersistentSymbolTable::self().declarations(id);
PersistentSymbolTable::Declarations::Iterator decl = decls.iterator();
for(; decl; ++decl) {
const IndexedDeclaration& iDecl(*decl);
......@@ -151,7 +151,7 @@ KDevVarLengthArray<Declaration*> DeclarationId::getDeclarations(const TopDUConte
return ret;
}
Declaration* DeclarationId::getDeclaration(const TopDUContext* top, bool instantiateIfRequired) const
Declaration* DeclarationId::declaration(const TopDUContext* top, bool instantiateIfRequired) const
{
Declaration* ret = nullptr;
......@@ -162,7 +162,7 @@ Declaration* DeclarationId::getDeclaration(const TopDUContext* top, bool instant
if(top) {
//Do filtering
PersistentSymbolTable::FilteredDeclarationIterator filter =
PersistentSymbolTable::self().getFilteredDeclarations(id, top->recursiveImportIndices());
PersistentSymbolTable::self().filteredDeclarations(id, top->recursiveImportIndices());
for(; filter; ++filter) {
Declaration* decl = filter->data();
if(decl && m_indirectData.additionalIdentity == decl->additionalIdentity()) {
......@@ -174,7 +174,7 @@ Declaration* DeclarationId::getDeclaration(const TopDUContext* top, bool instant
}
}else{
//Just accept anything
PersistentSymbolTable::Declarations decls = PersistentSymbolTable::self().getDeclarations(id);
PersistentSymbolTable::Declarations decls = PersistentSymbolTable::self().declarations(id);
PersistentSymbolTable::Declarations::Iterator decl = decls.iterator();
for(; decl; ++decl) {
const IndexedDeclaration& iDecl(*decl);
......@@ -226,7 +226,7 @@ QualifiedIdentifier DeclarationId::qualifiedIdentifier() const
return baseIdentifier;
return m_specialization.information().applyToIdentifier(baseIdentifier);
} else {
Declaration* decl = getDeclaration(nullptr);
Declaration* decl = declaration(nullptr);
if(decl)
return decl->qualifiedIdentifier();
......
......@@ -125,7 +125,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT DeclarationId {
if(m_isDirect)
return KDevHash() << m_directData.hash() << m_specialization.index();
else
return KDevHash() << m_indirectData.identifier.getIndex() << m_indirectData.additionalIdentity << m_specialization.index();
return KDevHash() << m_indirectData.identifier.index() << m_indirectData.additionalIdentity << m_specialization.index();
}
/**
......@@ -136,13 +136,13 @@ class KDEVPLATFORMLANGUAGE_EXPORT DeclarationId {
* \param instantiateIfRequired Whether the declaration should be instantiated if required
* \returns the referenced Declaration, or null if none was found.
* */
Declaration* getDeclaration(const TopDUContext* context, bool instantiateIfRequired = true) const;
Declaration* declaration(const TopDUContext* context, bool instantiateIfRequired = true) const;
/**
* Same as getDeclaration(..), but returns all matching declarations if there are multiple.
* Same as declaration(..), but returns all matching declarations if there are multiple.
* This also returns found forward-declarations.
*/
KDevVarLengthArray<Declaration*> getDeclarations(const TopDUContext* context) const;
KDevVarLengthArray<Declaration*> declarations(const TopDUContext* context) const;
/**
* Set the specialization index (see class documentation).
......
......@@ -369,7 +369,7 @@ Declaration* DUChainUtils::declarationInLine(const KTextEditor::Cursor& _cursor,
foreach(Declaration* decl, ctx->localDeclarations()) {
if(decl->range().start.line == cursor.line)
return decl;
DUContext* funCtx = getFunctionContext(decl);
DUContext* funCtx = functionContext(decl);
if(funCtx && funCtx->range().contains(cursor))
return decl;
}
......@@ -432,7 +432,7 @@ void DUChainUtils::collectItems( DUContext* context, DUChainItemFilter& filter )
}
}
KDevelop::DUContext* DUChainUtils::getArgumentContext(KDevelop::Declaration* decl) {
KDevelop::DUContext* DUChainUtils::argumentContext(KDevelop::Declaration* decl) {
DUContext* internal = decl->internalContext();
if( !internal )
return nullptr;
......@@ -463,7 +463,7 @@ QList<IndexedDeclaration> DUChainUtils::collectAllVersions(Declaration* decl) {
return ret;
}
static QList<Declaration*> getInheritersInternal(const Declaration* decl, uint& maxAllowedSteps, bool collectVersions)
static QList<Declaration*> inheritersInternal(const Declaration* decl, uint& maxAllowedSteps, bool collectVersions)
{
QList<Declaration*> ret;
......@@ -499,7 +499,7 @@ static QList<Declaration*> getInheritersInternal(const Declaration* decl, uint&
++maxAllowedSteps;
if(allDeclarations[a].data() && allDeclarations[a].data() != decl) {
ret += getInheritersInternal(allDeclarations[a].data(), maxAllowedSteps, false);
ret += inheritersInternal(allDeclarations[a].data(), maxAllowedSteps, false);
}
if(maxAllowedSteps == 0)
......@@ -510,9 +510,9 @@ static QList<Declaration*> getInheritersInternal(const Declaration* decl, uint&
return ret;
}
QList<Declaration*> DUChainUtils::getInheriters(const Declaration* decl, uint& maxAllowedSteps, bool collectVersions)
QList<Declaration*> DUChainUtils::inheriters(const Declaration* decl, uint& maxAllowedSteps, bool collectVersions)
{
auto inheriters = getInheritersInternal(decl, maxAllowedSteps, collectVersions);
auto inheriters = inheritersInternal(decl, maxAllowedSteps, collectVersions);
// remove duplicates
std::sort(inheriters.begin(), inheriters.end());
......@@ -521,7 +521,7 @@ QList<Declaration*> DUChainUtils::getInheriters(const Declaration* decl, uint& m
return inheriters;
}
QList<Declaration*> DUChainUtils::getOverriders(const Declaration* currentClass, const Declaration* overriddenDeclaration, uint& maxAllowedSteps) {
QList<Declaration*> DUChainUtils::overriders(const Declaration* currentClass, const Declaration* overriddenDeclaration, uint& maxAllowedSteps) {
QList<Declaration*> ret;
if(maxAllowedSteps == 0)
......@@ -530,8 +530,8 @@ QList<Declaration*> DUChainUtils::getOverriders(const Declaration* currentClass,
if(currentClass != overriddenDeclaration->context()->owner() && currentClass->internalContext())
ret += currentClass->internalContext()->findLocalDeclarations(overriddenDeclaration->identifier(), CursorInRevision::invalid(), currentClass->topContext(), overriddenDeclaration->abstractType());
foreach(Declaration* inheriter, getInheriters(currentClass, maxAllowedSteps))
ret += getOverriders(inheriter, overriddenDeclaration, maxAllowedSteps);
foreach(Declaration* inheriter, inheriters(currentClass, maxAllowedSteps))
ret += overriders(inheriter, overriddenDeclaration, maxAllowedSteps);
return ret;
}
......@@ -574,7 +574,7 @@ uint DUChainUtils::contextCountUses(DUContext* context, Declaration* declaration
return countUses(context, context->topContext()->indexForUsedDeclaration(declaration, false));
}
Declaration* DUChainUtils::getOverridden(const Declaration* decl) {
Declaration* DUChainUtils::overridden(const Declaration* decl) {
const ClassFunctionDeclaration* classFunDecl = dynamic_cast<const ClassFunctionDeclaration*>(decl);
if(!classFunDecl || !classFunDecl->isVirtual())
return nullptr;
......@@ -597,7 +597,7 @@ Declaration* DUChainUtils::getOverridden(const Declaration* decl) {
return nullptr;
}
DUContext* DUChainUtils::getFunctionContext(Declaration* decl) {
DUContext* DUChainUtils::functionContext(Declaration* decl) {