Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c50f4442 authored by Kevin Funk's avatar Kevin Funk

clang-tidy run: use-modernize-auto

parent c554b911
......@@ -51,7 +51,7 @@ KDevelopSessions::KDevelopSessions(QObject *parent, const QVariantList& args)
loadSessions();
// listen for changes to the list of kdevelop sessions
KDirWatch *historyWatch = new KDirWatch(this);
auto *historyWatch = new KDirWatch(this);
const QStringList sessiondirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QStringLiteral("kdevelop/sessions"), QStandardPaths::LocateDirectory);
for (const QString& dir : sessiondirs) {
......
......@@ -46,14 +46,14 @@ BreakpointDetails::BreakpointDetails(QWidget *parent)
: QWidget(parent)
, d(new BreakpointDetailsPrivate)
{
QVBoxLayout* layout = new QVBoxLayout(this);
auto* layout = new QVBoxLayout(this);
d->status = new QLabel(this);
connect(d->status, &QLabel::linkActivated,
this, &BreakpointDetails::showExplanation);
layout->addWidget(d->status);
QGridLayout* hitsLayout = new QGridLayout();
auto* hitsLayout = new QGridLayout();
layout->addLayout(hitsLayout);
hitsLayout->setContentsMargins(0, 0, 0, 0);
......
......@@ -110,7 +110,7 @@ void BreakpointModel::slotPartAdded(KParts::Part* part)
{
if (auto doc = qobject_cast<KTextEditor::Document*>(part))
{
MarkInterface *iface = dynamic_cast<MarkInterface*>(doc);
auto *iface = dynamic_cast<MarkInterface*>(doc);
if( !iface )
return;
......@@ -579,7 +579,7 @@ Breakpoint* BreakpointModel::breakpoint(int row) const
Breakpoint* BreakpointModel::addCodeBreakpoint()
{
beginInsertRows(QModelIndex(), d->breakpoints.count(), d->breakpoints.count());
Breakpoint* n = new Breakpoint(this, Breakpoint::CodeBreakpoint);
auto* n = new Breakpoint(this, Breakpoint::CodeBreakpoint);
endInsertRows();
return n;
}
......@@ -601,7 +601,7 @@ Breakpoint* BreakpointModel::addCodeBreakpoint(const QString& expression)
Breakpoint* BreakpointModel::addWatchpoint()
{
beginInsertRows(QModelIndex(), d->breakpoints.count(), d->breakpoints.count());
Breakpoint* n = new Breakpoint(this, Breakpoint::WriteBreakpoint);
auto* n = new Breakpoint(this, Breakpoint::WriteBreakpoint);
endInsertRows();
return n;
}
......@@ -616,7 +616,7 @@ Breakpoint* BreakpointModel::addWatchpoint(const QString& expression)
Breakpoint* BreakpointModel::addReadWatchpoint()
{
beginInsertRows(QModelIndex(), d->breakpoints.count(), d->breakpoints.count());
Breakpoint* n = new Breakpoint(this, Breakpoint::ReadBreakpoint);
auto* n = new Breakpoint(this, Breakpoint::ReadBreakpoint);
endInsertRows();
return n;
}
......@@ -631,7 +631,7 @@ Breakpoint* BreakpointModel::addReadWatchpoint(const QString& expression)
Breakpoint* BreakpointModel::addAccessWatchpoint()
{
beginInsertRows(QModelIndex(), d->breakpoints.count(), d->breakpoints.count());
Breakpoint* n = new Breakpoint(this, Breakpoint::AccessBreakpoint);
auto* n = new Breakpoint(this, Breakpoint::AccessBreakpoint);
endInsertRows();
return n;
}
......
......@@ -90,7 +90,7 @@ BreakpointWidget::BreakpointWidget(IDebugController *controller, QWidget *parent
setStretchFactor(0, 2);
PlaceholderItemProxyModel* proxyModel = new PlaceholderItemProxyModel(this);
auto* proxyModel = new PlaceholderItemProxyModel(this);
proxyModel->setSourceModel(d->debugController->breakpointModel());
proxyModel->setColumnHint(Breakpoint::LocationColumn, i18n("New code breakpoint ..."));
proxyModel->setColumnHint(Breakpoint::ConditionColumn, i18n("Enter condition ..."));
......
......@@ -77,7 +77,7 @@ void IVariableController::stateChanged(IDebugSession::DebuggerState state)
}
for (int i=0; i < variableCollection()->watches()->childCount(); ++i) {
Variable *var = qobject_cast<Variable*>(variableCollection()->watches()->child(i));
auto *var = qobject_cast<Variable*>(variableCollection()->watches()->child(i));
if (var) {
var->setInScope(false);
}
......
......@@ -212,7 +212,7 @@ private:
PathMappingsWidget::PathMappingsWidget(QWidget* parent): QWidget(parent)
{
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
auto *verticalLayout = new QVBoxLayout(this);
m_pathMappingTable = new QTableView(this);
m_pathMappingTable->setSelectionBehavior(QAbstractItemView::SelectRows);
......
......@@ -68,7 +68,7 @@ QVariant TreeModel::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
auto *item = static_cast<TreeItem*>(index.internalPointer());
if (role == ItemRole)
return QVariant::fromValue(item);
......@@ -117,7 +117,7 @@ QModelIndex TreeModel::parent(const QModelIndex &index) const
if (!index.isValid())
return QModelIndex();
TreeItem *childItem = static_cast<TreeItem*>(index.internalPointer());
auto *childItem = static_cast<TreeItem*>(index.internalPointer());
TreeItem *parentItem = childItem->parent();
if (parentItem == d->root)
......@@ -202,7 +202,7 @@ bool TreeModel::setData(const QModelIndex& index, const QVariant& value,
&& (role == Qt::EditRole || role == Qt::CheckStateRole))
{
TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
auto *item = static_cast<TreeItem*>(index.internalPointer());
item->setColumn(index.column(), value);
return true;
}
......
......@@ -124,7 +124,7 @@ void Variable::setInScope(bool v)
{
m_inScope = v;
for (int i=0; i < childCount(); ++i) {
if (Variable *var = qobject_cast<Variable*>(child(i))) {
if (auto *var = qobject_cast<Variable*>(child(i))) {
var->setInScope(v);
}
}
......@@ -315,7 +315,7 @@ void Watches::reinstall()
{
for (int i = 0; i < childItems.size(); ++i)
{
Variable* v = static_cast<Variable*>(child(i));
auto* v = static_cast<Variable*>(child(i));
v->attachMaybe();
}
}
......@@ -332,7 +332,7 @@ QList<Variable*> Locals::updateLocals(const QStringList& locals)
for (int i = 0; i < childItems.size(); i++)
{
Q_ASSERT(qobject_cast<KDevelop::Variable*>(child(i)));
Variable* var= static_cast<KDevelop::Variable*>(child(i));
auto* var= static_cast<KDevelop::Variable*>(child(i));
existing << var->expression();
}
......@@ -352,7 +352,7 @@ QList<Variable*> Locals::updateLocals(const QStringList& locals)
}
for (int i = 0; i < childItems.size(); ++i) {
KDevelop::Variable* v = static_cast<KDevelop::Variable*>(child(i));
auto* v = static_cast<KDevelop::Variable*>(child(i));
if (!current.contains(v->expression())) {
removeChild(i);
--i;
......@@ -492,7 +492,7 @@ void VariableCollection::viewCreated(KTextEditor::Document* doc,
{
Q_UNUSED(doc);
using namespace KTextEditor;
TextHintInterface *iface = dynamic_cast<TextHintInterface*>(view);
auto *iface = dynamic_cast<TextHintInterface*>(view);
if( !iface )
return;
......
......@@ -95,7 +95,7 @@ VariableToolTip::VariableToolTip(QWidget* parent, const QPoint& position,
m_model = new TreeModel(QVector<QString>{i18n("Name"), i18n("Value"), i18n("Type")}, this);
TooltipRoot* tr = new TooltipRoot(m_model);
auto* tr = new TooltipRoot(m_model);
m_model->setRootItem(tr);
m_var = ICore::self()->debugController()->currentSession()->
variableController()->createVariable(
......@@ -103,7 +103,7 @@ VariableToolTip::VariableToolTip(QWidget* parent, const QPoint& position,
tr->init(m_var);
m_var->attachMaybe(this, "variableCreated");
QVBoxLayout* l = new QVBoxLayout(this);
auto* l = new QVBoxLayout(this);
l->setContentsMargins(0, 0, 0, 0);
// setup proxy model
m_proxy = new QSortFilterProxyModel;
......@@ -129,7 +129,7 @@ VariableToolTip::VariableToolTip(QWidget* parent, const QPoint& position,
m_selection->select(varIndex,
QItemSelectionModel::Rows | QItemSelectionModel::ClearAndSelect);
QHBoxLayout* buttonBox = new QHBoxLayout();
auto* buttonBox = new QHBoxLayout();
buttonBox->setContentsMargins(11, 0, 11, 6);
QPushButton* watchThisButton = new QPushButton(i18n("Watch This"));
buttonBox->addWidget(watchThisButton);
......@@ -141,13 +141,13 @@ VariableToolTip::VariableToolTip(QWidget* parent, const QPoint& position,
connect(stopOnChangeButton, &QPushButton::clicked,
this, [this](){ slotLinkActivated(QStringLiteral("add_watchpoint")); });
QHBoxLayout* inner = new QHBoxLayout();
auto* inner = new QHBoxLayout();
l->addLayout(inner);
inner->setContentsMargins(0, 0, 0, 0);
inner->addLayout(buttonBox);
inner->addStretch();
SizeGrip* g = new SizeGrip(this);
auto* g = new SizeGrip(this);
g->setFixedSize(16, 16);
inner->addWidget(g, 0, (Qt::Alignment)(Qt::AlignRight | Qt::AlignBottom));
......@@ -175,7 +175,7 @@ void VariableToolTip::slotLinkActivated(const QString& link)
TreeItem *item = m_model->itemForIndex(sourceIndex);
if (item)
{
Variable* v2 = qobject_cast<Variable*>(item);
auto* v2 = qobject_cast<Variable*>(item);
if (v2)
v = v2;
}
......
......@@ -83,7 +83,7 @@ VariableWidget::VariableWidget(IDebugController* controller, QWidget *parent)
m_watchVarEditor = new KHistoryComboBox( this );
QVBoxLayout *topLayout = new QVBoxLayout(this);
auto *topLayout = new QVBoxLayout(this);
topLayout->addWidget(m_varTree, 10);
topLayout->addWidget(m_watchVarEditor);
topLayout->setMargin(0);
......@@ -199,7 +199,7 @@ void VariableTree::setupActions()
// make Format menu action group
m_formatMenu = new QMenu(i18n("&Format"), this);
QActionGroup *ag= new QActionGroup(m_formatMenu);
auto *ag= new QActionGroup(m_formatMenu);
QAction* act;
......
......@@ -371,7 +371,7 @@ void ProvidersModel::unloaded(IPlugin* plugin)
{
removeProvider(plugin->extension<IDocumentationProvider>());
IDocumentationProviderProvider* providerProvider = plugin->extension<IDocumentationProviderProvider>();
auto* providerProvider = plugin->extension<IDocumentationProviderProvider>();
if (providerProvider) {
foreach(IDocumentationProvider* provider, providerProvider->providers())
removeProvider(provider);
......@@ -382,7 +382,7 @@ void ProvidersModel::loaded(IPlugin* plugin)
{
addProvider(plugin->extension<IDocumentationProvider>());
IDocumentationProviderProvider* providerProvider = plugin->extension<IDocumentationProviderProvider>();
auto* providerProvider = plugin->extension<IDocumentationProviderProvider>();
if (providerProvider) {
foreach(IDocumentationProvider* provider, providerProvider->providers())
addProvider(provider);
......
......@@ -101,7 +101,7 @@ IPlugin::IPlugin( const QString &componentName, QObject *parent )
d->guiClientAdded(client);
};
foreach (KMainWindow* mw, KMainWindow::memberList()) {
KXmlGuiWindow* guiWindow = qobject_cast<KXmlGuiWindow*>(mw);
auto* guiWindow = qobject_cast<KXmlGuiWindow*>(mw);
if (! guiWindow)
continue;
......
......@@ -159,7 +159,7 @@ struct DocumentParsePlan
TopDUContext::Features features() const
{
//Pick the best features
TopDUContext::Features ret = ( TopDUContext::Features )0;
auto ret = ( TopDUContext::Features )0;
for (const DocumentParseTarget& target : targets) {
ret = ( TopDUContext::Features ) (ret | target.features);
}
......@@ -221,7 +221,7 @@ public:
{
int bestRunningPriority = BackgroundParser::WorstPriority;
for (const auto* decorator : m_parseJobs) {
const ParseJob* parseJob = dynamic_cast<const ParseJob*>(decorator->job());
const auto* parseJob = dynamic_cast<const ParseJob*>(decorator->job());
Q_ASSERT(parseJob);
if (parseJob->respectsSequentialProcessing() && parseJob->parsePriority() < bestRunningPriority) {
bestRunningPriority = parseJob->parsePriority();
......@@ -378,7 +378,7 @@ public:
job->setNotifyWhenReady(notifyWhenReady);
job->setSequentialProcessingFlags(parsePlan.sequentialProcessingFlags());
ThreadWeaver::QObjectDecorator* decorator = new ThreadWeaver::QObjectDecorator(job);
auto* decorator = new ThreadWeaver::QObjectDecorator(job);
QObject::connect(decorator, &ThreadWeaver::QObjectDecorator::done,
m_parser, &BackgroundParser::parseComplete);
......@@ -668,7 +668,7 @@ void BackgroundParser::parseComplete(const ThreadWeaver::JobPointer& job)
{
auto decorator = dynamic_cast<ThreadWeaver::QObjectDecorator*>(job.data());
Q_ASSERT(decorator);
ParseJob* parseJob = dynamic_cast<ParseJob*>(decorator->job());
auto* parseJob = dynamic_cast<ParseJob*>(decorator->job());
Q_ASSERT(parseJob);
emit parseJobFinished(parseJob);
......
......@@ -169,7 +169,7 @@ bool ParseJob::hasStaticMinimumFeatures()
TopDUContext::Features ParseJob::staticMinimumFeatures(const IndexedString& url)
{
QMutexLocker lock(&minimumFeaturesMutex);
TopDUContext::Features features = ( TopDUContext::Features )0;
auto features = ( TopDUContext::Features )0;
if (::staticMinimumFeatures.contains(url))
foreach (const TopDUContext::Features f, ::staticMinimumFeatures[url])
......
......@@ -75,7 +75,7 @@ void JobPlan::parseJobCreated(ParseJob* job)
return;
}
TestParseJob* testJob = dynamic_cast<TestParseJob*>(job);
auto* testJob = dynamic_cast<TestParseJob*>(job);
Q_ASSERT(testJob);
qDebug() << "assigning propierties for created job" << testJob->document().toUrl();
......@@ -185,7 +185,7 @@ void TestBackgroundparser::initTestCase()
DUChain::self()->disablePersistentStorage();
TestLanguageController* langController = new TestLanguageController(core);
auto* langController = new TestLanguageController(core);
core->setLanguageController(langController);
langController->backgroundParser()->setThreadCount(4);
langController->backgroundParser()->abortAllJobs();
......
......@@ -197,7 +197,7 @@ KDevelop::DUChainBase* ClassModel::duObjectForIndex(const QModelIndex& a_index)
Node* node = static_cast<Node*>(a_index.internalPointer());
if (IdentifierNode* identifierNode = dynamic_cast<IdentifierNode*>(node))
if (auto* identifierNode = dynamic_cast<IdentifierNode*>(node))
return identifierNode->declaration();
// Non was found.
......
......@@ -83,7 +83,7 @@ bool EnumNode::getIcon(QIcon& a_resultIcon)
{
DUChainReadLocker readLock(DUChain::lock());
ClassMemberDeclaration* decl = dynamic_cast<ClassMemberDeclaration*>(declaration());
auto* decl = dynamic_cast<ClassMemberDeclaration*>(declaration());
if (decl == nullptr) {
static QIcon Icon = QIcon::fromTheme(QStringLiteral("enum"));
a_resultIcon = Icon;
......@@ -158,7 +158,7 @@ bool ClassNode::updateClassDeclarations()
bool hadChanges = false;
SubIdentifiersMap existingIdentifiers = m_subIdentifiers;
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>(declaration());
auto* klass = dynamic_cast<ClassDeclaration*>(declaration());
if (klass) {
foreach (Declaration* decl, klass->internalContext()->localDeclarations()) {
......@@ -178,9 +178,9 @@ bool ClassNode::updateClassDeclarations()
newNode = new EnumNode(decl, m_model);
else if (decl->isFunctionDeclaration())
newNode = new FunctionNode(decl, m_model);
else if (ClassDeclaration* classDecl = dynamic_cast<ClassDeclaration*>(decl))
else if (auto* classDecl = dynamic_cast<ClassDeclaration*>(decl))
newNode = new ClassNode(classDecl, m_model);
else if (ClassMemberDeclaration* memDecl = dynamic_cast<ClassMemberDeclaration*>(decl))
else if (auto* memDecl = dynamic_cast<ClassMemberDeclaration*>(decl))
newNode = new ClassMemberNode(memDecl, m_model);
else
{
......@@ -216,14 +216,14 @@ bool ClassNode::addBaseAndDerived()
{
bool added = false;
BaseClassesFolderNode* baseClassesNode = new BaseClassesFolderNode(m_model);
auto* baseClassesNode = new BaseClassesFolderNode(m_model);
addNode(baseClassesNode);
if (!baseClassesNode->hasChildren())
removeNode(baseClassesNode);
else
added = true;
DerivedClassesFolderNode* derivedClassesNode = new DerivedClassesFolderNode(m_model);
auto* derivedClassesNode = new DerivedClassesFolderNode(m_model);
addNode(derivedClassesNode);
if (!derivedClassesNode->hasChildren())
removeNode(derivedClassesNode);
......@@ -259,7 +259,7 @@ ClassNode* ClassNode::findSubClass(const KDevelop::IndexedQualifiedIdentifier& a
/// @todo This is slow - we go over all the sub identifiers but the assumption is that
/// this function call is rare and the list is not that long.
foreach (Node* item, m_subIdentifiers) {
ClassNode* classNode = dynamic_cast<ClassNode*>(item);
auto* classNode = dynamic_cast<ClassNode*>(item);
if (classNode == nullptr)
continue;
......@@ -281,7 +281,7 @@ FunctionNode::FunctionNode(Declaration* a_decl, NodesModelInterface* a_model)
m_displayName += type->partToString(FunctionType::SignatureArguments);
// Add special values for ctor / dtor to sort first
ClassFunctionDeclaration* classmember = dynamic_cast<ClassFunctionDeclaration*>(a_decl);
auto* classmember = dynamic_cast<ClassFunctionDeclaration*>(a_decl);
if (classmember) {
if (classmember->isConstructor() || classmember->isDestructor())
m_sortableString = QLatin1Char('0') + m_displayName;
......@@ -304,7 +304,7 @@ bool ClassMemberNode::getIcon(QIcon& a_resultIcon)
{
DUChainReadLocker readLock(DUChain::lock());
ClassMemberDeclaration* decl = dynamic_cast<ClassMemberDeclaration*>(declaration());
auto* decl = dynamic_cast<ClassMemberDeclaration*>(declaration());
if (decl == nullptr)
return false;
......@@ -368,7 +368,7 @@ void BaseClassesFolderNode::populateNode()
{
DUChainReadLocker readLock(DUChain::lock());
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>(static_cast<ClassNode*>(parent())->declaration());
auto* 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
// to get to the base class identifier which is not directly accessible through the
......@@ -398,7 +398,7 @@ void DerivedClassesFolderNode::populateNode()
{
DUChainReadLocker readLock(DUChain::lock());
ClassDeclaration* klass = dynamic_cast<ClassDeclaration*>(static_cast<ClassNode*>(parent())->declaration());
auto* klass = dynamic_cast<ClassDeclaration*>(static_cast<ClassNode*>(parent())->declaration());
if (klass) {
uint steps = 10000;
const QList<Declaration*> inheriters = DUChainUtils::inheriters(klass, steps, true);
......
......@@ -410,7 +410,7 @@ StaticNamespaceFolderNode* DocumentClassesFolder::namespaceFolder(const KDevelop
parentNode = this;
// Create the new node.
StaticNamespaceFolderNode* newNode =
auto* newNode =
new StaticNamespaceFolderNode(a_identifier, m_model);
parentNode->addNode(newNode);
......
......@@ -44,7 +44,7 @@ CodeCompletion::CodeCompletion(QObject* parent, KTextEditor::CodeCompletionModel
, m_model(aModel)
, m_language(language)
{
KDevelop::CodeCompletionModel* kdevModel = dynamic_cast<KDevelop::CodeCompletionModel*>(aModel);
auto* kdevModel = dynamic_cast<KDevelop::CodeCompletionModel*>(aModel);
if (kdevModel)
kdevModel->initialize();
connect(KDevelop::ICore::self()->documentController(), &IDocumentController::textDocumentCreated,
......@@ -74,7 +74,7 @@ void CodeCompletion::viewCreated(KTextEditor::Document* document, KTextEditor::V
{
Q_UNUSED(document);
if (CodeCompletionInterface* cc = dynamic_cast<CodeCompletionInterface*>(view)) {
if (auto* cc = dynamic_cast<CodeCompletionInterface*>(view)) {
cc->registerCompletionModel(m_model);
qCDebug(LANGUAGE) << "Registered completion model";
emit registeredToView(view);
......@@ -100,7 +100,7 @@ void CodeCompletion::textDocumentCreated(KDevelop::IDocument* document)
void CodeCompletion::unregisterDocument(Document* textDocument)
{
foreach (KTextEditor::View* view, textDocument->views()) {
if (CodeCompletionInterface* cc = dynamic_cast<CodeCompletionInterface*>(view)) {
if (auto* cc = dynamic_cast<CodeCompletionInterface*>(view)) {
cc->unregisterCompletionModel(m_model);
emit unregisteredFromView(view);
}
......
......@@ -299,7 +299,7 @@ void CodeCompletionModel::executeCompletionItem(View* view, const KTextEditor::R
const QModelIndex& index) const
{
//We must not lock the duchain at this place, because the items might rely on that
CompletionTreeElement* element = static_cast<CompletionTreeElement*>(index.internalPointer());
auto* element = static_cast<CompletionTreeElement*>(index.internalPointer());
if (!element || !element->asItem())
return;
......@@ -309,7 +309,7 @@ void CodeCompletionModel::executeCompletionItem(View* view, const KTextEditor::R
QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> CodeCompletionModel::itemForIndex(const QModelIndex& index)
const
{
CompletionTreeElement* element = static_cast<CompletionTreeElement*>(index.internalPointer());
auto* element = static_cast<CompletionTreeElement*>(index.internalPointer());
return QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement>(element);
}
......@@ -392,7 +392,7 @@ void CodeCompletionModel::setCurrentTopContext(const KDevelop::TopDUContextPoint
QModelIndex CodeCompletionModel::index(int row, int column, const QModelIndex& parent) const
{
if (parent.isValid()) {
CompletionTreeElement* element = static_cast<CompletionTreeElement*>(parent.internalPointer());
auto* element = static_cast<CompletionTreeElement*>(parent.internalPointer());
CompletionTreeNode* node = element->asNode();
......@@ -419,7 +419,7 @@ QModelIndex CodeCompletionModel::parent(const QModelIndex& index) const
return QModelIndex();
if (index.isValid()) {
CompletionTreeElement* element = static_cast<CompletionTreeElement*>(index.internalPointer());
auto* element = static_cast<CompletionTreeElement*>(index.internalPointer());
if (element->parent())
return createIndex(element->rowInParent(), element->columnInParent(), element->parent());
......@@ -431,7 +431,7 @@ QModelIndex CodeCompletionModel::parent(const QModelIndex& index) const
int CodeCompletionModel::rowCount(const QModelIndex& parent) const
{