forked from qt-creator/qt-creator
Add a changed signal in Aggregation
Use it to change the find and candidate find object in CurrentDocumentFind: this will allow to replace the IFindSupport object used. Merge-request: 115 Reviewed-by: con <qtc-committer@nokia.com>
This commit is contained in:
committed by
con
parent
e2297e4cbd
commit
d3b58c2db3
@@ -232,15 +232,18 @@ void Aggregate::add(QObject *component)
|
||||
{
|
||||
if (!component)
|
||||
return;
|
||||
QWriteLocker locker(&lock());
|
||||
Aggregate *parentAggregation = aggregateMap().value(component);
|
||||
if (parentAggregation == this)
|
||||
return;
|
||||
if (parentAggregation)
|
||||
parentAggregation->remove(component);
|
||||
m_components.append(component);
|
||||
connect(component, SIGNAL(destroyed(QObject*)), this, SLOT(deleteSelf(QObject*)));
|
||||
aggregateMap().insert(component, this);
|
||||
{
|
||||
QWriteLocker locker(&lock());
|
||||
Aggregate *parentAggregation = aggregateMap().value(component);
|
||||
if (parentAggregation == this)
|
||||
return;
|
||||
if (parentAggregation)
|
||||
parentAggregation->remove(component);
|
||||
m_components.append(component);
|
||||
connect(component, SIGNAL(destroyed(QObject*)), this, SLOT(deleteSelf(QObject*)));
|
||||
aggregateMap().insert(component, this);
|
||||
}
|
||||
emit changed();
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -254,8 +257,11 @@ void Aggregate::remove(QObject *component)
|
||||
{
|
||||
if (!component)
|
||||
return;
|
||||
QWriteLocker locker(&lock());
|
||||
aggregateMap().remove(component);
|
||||
m_components.removeAll(component);
|
||||
disconnect(component, SIGNAL(destroyed(QObject*)), this, SLOT(deleteSelf(QObject*)));
|
||||
{
|
||||
QWriteLocker locker(&lock());
|
||||
aggregateMap().remove(component);
|
||||
m_components.removeAll(component);
|
||||
disconnect(component, SIGNAL(destroyed(QObject*)), this, SLOT(deleteSelf(QObject*)));
|
||||
}
|
||||
emit changed();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user