Don't need delete properties in method itemClicked.

--HG--
branch : feature
This commit is contained in:
dismine 2014-08-26 23:04:01 +03:00
parent 70a17f118e
commit 670e185465
2 changed files with 8 additions and 13 deletions

View file

@ -67,17 +67,12 @@ void VToolOptionsPropertyBrowser::itemClicked(QGraphicsItem *item)
return;
}
QMap<VProperty *, QString>::ConstIterator itProp = propertyToId.constBegin();
while (itProp != propertyToId.constEnd())
{
delete itProp.key();
itProp++;
}
PropertyModel->clear();
propertyToId.clear();
idToProperty.clear();
currentItem = item;
PropertyModel->clear();
if (currentItem == nullptr)
{
return;

View file

@ -103,12 +103,12 @@ int VPropertySet::count() const
void VPropertySet::clear(bool delete_properties)
{
d_ptr->Properties.clear();
// while(!d_ptr->RootProperties.isEmpty()) {
// VProperty* tmpProp = d_ptr->RootProperties.takeLast();
// if(tmpProp != NULL && delete_properties) {
// delete tmpProp;
// }
// }
while(!d_ptr->RootProperties.isEmpty()) {
VProperty* tmpProp = d_ptr->RootProperties.takeLast();
if(tmpProp != nullptr && delete_properties) {
delete tmpProp;
}
}
}
QString VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_id) const